ByteDance·Software Engineer·Technical Phone Screen
- You have an integer array and a target value T. Starting at index 0, you can jump forward 1 to 10 positions at a time. Each index has a cost equal to its value. Find the minimum number of jumps needed to land on an index whose value equals T. Return -1 if no reachable index has that value.
“My first instinct was dynamic programming because of the 'minimum steps' framing and the jump constraint, which felt like a classic staircase problem.”