Build a game known as Boggle, find the words of a dictionary from a grid of characters in this game.


Given an n×nn \times n grid of characters and a dictionary, find all the words that can be made from the characters in the grid and are present in the given dictionary.

  • A word can start and end at any character in the grid.

  • The next character must be adjacent to the previous character in any direction: up, down, left, right, or along any diagonal.

  • We can use the character at each position in the grid only once while making a word.

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.