Explore a grid to find if a word can be formed by adjacent cells without revisiting.
Constraints
Example
>>> exists(["ABCE", "SFCS", "ADEE"], "ABCCED") True >>> exists(["ABCE", "SFCS", "ADEE"], "SEE") True >>> exists(["ABCE", "SFCS", "ADEE"], "ABCB") False
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints