While I was attempting the question Tri Graphs on spoj I am constantly getting WA for that. Please help me to find the mistake. My code is as follows
asked 19 Jan '17, 11:59

In each dp[i][j], you are storing the shortest path to reach from (i, j) to (n  1, 1). [0indexed]
This base case assumes that state (n  1, 1) is reachable from state (n  1, 2) while this is not true for the graph structure as mentioned in the problem.
answered 19 Jan '17, 13:45
