Back to problems

Hopscotch

Algorithm · Atlassian · Medium

(This question is a follow-up to LeetCode 1306, Jump Game III; solving that problem first is recommended.) You are given a one-dimensional board encoded by an array of strings s of length n. Each entry s[i] either defines the moves permitted from cell i, or marks that cell as blocked. If s[i] equals "X", cell i is an obstacle. You cannot start from it, step onto it, or land on it. Otherwise, s[i] consists of one or more move directives. Every directive begins with "L" (move…

Checking your access…