Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Create an array dp where dp[i][j] is the min edit distance for the path starting at node i and compared to index j of the targetPath.
Traverse the dp array to obtain a valid answer.