Word Search

Medium

📝 Description

Check if word exists in 2D board (adjacent letters)

Input Format

2D board and word string

Output Format

true/false

Constraints

m == board.length

🔍 Sample Input

[["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]]
"ABCCED"
            

✅ Sample Output

true
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run