Prime Jumps
There are n cells indexed from 0 to n - 1. Each cell has an integer value, and cell[0] = 0.
You start at cell 0. In one move, you may:
- Move one cell to the right; or
- Jump
pcells t...
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Standard Input
Execution Result:
