I was trying to solve the following problem using dfs approach but unable to pass all the test cases.
The approach i used to solve it is that i made a chk function which checks for whether the pair (x,y) can be a part of path(as it will be a part of the path if it doesnt lie under any circle).Then i applied dfs from (0,0) to (A,B) and after that i checked whether we are able to visit A,B or not.
I only considered the paths where x and y are increasing because A and B are positive so it is not required to consider the decrement in x and y.
Please debug the code and tell where the problem is
Test case at which it fails:-
A : 10
B : 99
C : 8
D : 2
E : [ 5, 2, 4, 6, 4, 3, 8, 1 ]
F : [ 47, 32, 35, 8, 64, 97, 43, 49 ]
Ans should be yes and it is giving no