i the token shifts by exactly i cells, either left or right, your choice.
Return the smallest number of moves after which the token can land exactly on point goal.goal=4 → 3
Two moves reach at most point 3. Three moves cover 1 + 2 + 3 = 6, and making the first move to the left gives −1 + 2 + 3 = 4.
goal=-6 → 3
Three moves to the left: −1 − 2 − 3 = −6.
goal=2 → 3
goal=4
3
Run checks the first 3 tests in your browser. Submit checks all 72 tests on the server, hidden ones included.