T9 Dictionary Using Pre-Computed map
How can the T9 dictionary be implemented?
Solution:
- We can use DFS to create all possible words
- Or, Tries for better optimisation
- Or, Pre-computed in hash map
Pre-Computed map Algorithm:
- During object create compute map to number to list of words
- And on method call return return word list just by lookup in map
Latest Source Code:
Github: T9Dictionary2.java
Output: