You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks Rishab for reporting this issue. Yes, you are right this is not the correct approach, we have to take care of the assumption that robot can only go on flat areas(that is on 1s) not on trenches(represented by 0).
I think, using DP with memoization will solve this problem.
Unfortunately, i will have to have remove this code snippet as i got a notice from DMCA.
Try the following input lot
Correct Answer: 15
Algorithm's Ouptut: 2
The text was updated successfully, but these errors were encountered: