Dsa
Backtracking
Warm-up
Word Search
You are given a 2D board of characters and a string word. Return true if the word exists in the grid, where the word can be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once. If the word exists, print 'True', otherwise print 'False'.
Example:
Input:
4 4
A B C E
S F C S
A D E E
S C S
word: ABCCED
Output:
True
Key concepts
backtrackingsearchgrid
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now