Problem 3629 · Medium

Minimum Jumps to Reach End via Prime Teleportation

Run breadth-first search over indices; from a prime value, teleport once to every index whose value that prime divides.

Open the interactive visualisation