Back to problems

Word Search (LC 79)

Algorithm · Amazon · Medium

You are given a rectangular grid of characters and a nonempty target string. Decide whether the target can be spelled out by walking through the grid: each step moves to a cell directly above, below, left, or right of the previous one, and no single cell may be visited more than once along the same path. Return whether such a path exists. Follow-ups In one version of this exercise, the problem continues with the multiword variant known as Word Search II. Interview Notes This…

Loading the rest of the question…