Hello…
Wishing You a happy new year…
Here i am trying to solve a graph problem from hackerearth…
I have explained the logic what i have followed pretty well in code with comments…
I have used recursion… I think here we are not recomputiong anything … so i haven’t tried to memoize anything…
This is my submission…
https://www.hackerearth.com/submission/51802113/
Please look at this…
It is showing wrong answer for 1 test case and tle for some.
Thanks.
Happy New Year…