Algorithm · Karat · Medium
Consider a board game played on a track of numbered squares. Certain squares contain a teleporter. On each turn, the player rolls a die and moves accordingly. The task has two parts: From a given position, list every square on which the player could finish a single turn. Given a starting square, determine whether the player can eventually reach the final square of the board, using as many turns as needed. Examples Example