Skip to content

Latest commit

 

History

History
73 lines (47 loc) · 933 Bytes

i638.boggle_game.md

File metadata and controls

73 lines (47 loc) · 933 Bytes

635 · Boggle Game

Hard

https://www.lintcode.com/problem/635/

Description

Given a board which is a 2D matrix includes a-z and dictionary dict, find the largest collection of words on the board, the words can not overlap in the same position. return the size of largest collection.

The words in the dictionary are not repeated.

You can reuse the words in the dictionary.

Example

Example 1:

Input:
["abc","def","ghi"]
["abc","defi","gh"]

Output:
3

Explanation:
we can get the largest collection`["abc", "defi", "gh"]`


Example 2:

Input:
["aaaa","aaaa","aaaa","aaaa"]
["a"]

Output:
16

Explanation:
we can get the largest collection`["a", "a","a","a","a","a","a","a","a","a","a","a","a","a","a","a"]`

Tags

  • Depth First Search/DFS
  • Trie

Company

  • Airbnb

Related Problems

  • 802 Sudoku Solver Hard
  • 634 Word Squares Hard
  • 623 K Edit Distance Hard
  • 527 Trie Serialization Hard
  • 132 Word Search II Hard