This commit is contained in:
2019-11-14 10:07:56 +01:00
3 changed files with 29 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
const canJump = (arr, pos = 0) => {
if (pos >= arr.length) return true;
if (pos === arr.length - 1) return false;
for (let i = arr[pos]; i > 0; --i) {
if (canJump(arr, pos + i)) return true;
}