Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Implement a function to solve the Word Search problem on a grid (given a 2D grid of characters, find if a word exists)

Hard

Problem Statement

Implement a function to solve the Word Search problem on a grid (given a 2D grid of characters, find if a word exists)

Sample Input

board = [['A', 'B', 'C', 'E'], ['S', 'F', 'C', 'S'], ['A', 'D', 'E', 'E']]
 word = 'ABCCED'

Sample Output

true

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
import java.util.*; public class Main { public static boolean exist() { char[][] board = { {'A', 'B', 'C', 'E'}, {'S', 'F', 'C', 'S'}, {'A', 'D', 'E', 'E'} }; String word = "ABCCED"; // Your code here return false; } }
Log in or sign up to run or submit your code.Log inSign up
Input
board = [['A', 'B', 'C', 'E'], ['S', 'F', 'C', 'S'], ['A', 'D', 'E', 'E']]
 word = 'ABCCED'
Expected Output
true