Given array of whole numbers and a starting index, find out if you can win.
Winning means ending up at an array value of 0
If you are at a position that has a value that is not a 0, you can move value times to the left or to the right
[1, 3, 0, 2, 2], i == 0 -> true
[1, 1], i == 1 -> false
Read full article from Misc | Lei Jiang Coding
No comments:
Post a Comment