【Amazon面经】OA 2019 | Jump Game 其他公司 OA 开发岗

胖蛋 2020-5-19 564


You are given an array of non-negative integers arr and a start index. When you are at an index i, you can move left or right by arr[i]. Your task is to figure out if you can reach value 0.

Example 1:

Input: arr = [3, 4, 2, 3, 0, 3, 1, 2, 1], start = 7

Output: true

Explanation: left -> left -> right

Related problems:

最后于 2020-6-1 被maomoke编辑 ,原因:
最新回复 (0)
返回