Sponsored
Use these hints if you're stuck. Try solving on your own first.
Consider for each reachable index i the interval [i + a, i + b].
Use partial sums to mark the intervals as reachable.
Solve with full IDE support and test cases