0% completed
This problem and the basic solution (brute force recursive) are very confusing t...
Ray
Jul 19, 2022
This problem and the basic solution (brute force recursive) are very confusing to me.
I was able to brute force (iterate through jumps array in order) to get the answer. Assuming you need to go in-order through the jumps array (no skipping items & can't duplicate), a simple iteration loop (no recursion) works fine.
I realize this is the DP course so recursive top-down with memo is common/expected.
I find the brute force recursive Basic Solution extremely hard to understand. Specifically starting on index + 1 instead of starting from index 0 and using that (index 0) jump distance value.
0
0
Comments
Shan 3 years ago
Each value i.e. jumps[i] represents the jump range. Therefore you have to start at index + 1. For example if the first value in the jumps array is 3 then you can jump 1, 2, or 3 from the current index.
If the value is 0 then that is considered a edge case and is handle...
On this page