diff options
| author | mo khan <mo.khan@gmail.com> | 2020-10-20 13:03:00 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-10-20 13:03:00 -0600 |
| commit | 8490914034d2f733b099de282d84e043da794476 (patch) | |
| tree | eb3a03eba17d4b359af0e979898afffbffe902b6 /2020/10 | |
| parent | 00977df7cc491993c1ea305eb244c83f1df217c5 (diff) | |
Add problem of the day
Diffstat (limited to '2020/10')
| -rw-r--r-- | 2020/10/20/README.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/2020/10/20/README.md b/2020/10/20/README.md new file mode 100644 index 0000000..ca3a845 --- /dev/null +++ b/2020/10/20/README.md @@ -0,0 +1,24 @@ +Starting at index 0, for an element n at index i, +you are allowed to jump at most n indexes ahead. + +Given a list of numbers, find the minimum number of jumps to reach the end of +the list. + +Example: + +Input: [3, 2, 5, 1, 1, 9, 3, 4] +Output: 2 + +Explanation: + +The minimum number of jumps to get to the end of the list is 2: + 3 -> 5 -> 4 + +Here's a starting point: + +```python +def jumpToEnd(nums): + # Fill this in. +print jumpToEnd([3, 2, 5, 1, 1, 9, 3, 4]) +# 2 +`` |
