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:

  1. Move one cell to the right; or
  2. Jump p cells 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: