This commit is contained in:
2019-11-14 08:26:27 +01:00
parent 67173a0f94
commit 70fc636d6c

9
jump/index.js Normal file
View File

@@ -0,0 +1,9 @@
// https://www.codewars.com/kata/594fae1a0462da7beb000046
const canJump = (arr, pos = 0) => {
if (pos >= arr.length) return true;
for (let i = arr[pos]; i > 0; --i) {
if (canJump(arr, pos + i)) return true;
}
return false;
};