This was asked in an interview.
I think the answer can be made by constructing a trie of all valid words, and then sentences can be made based on a valid path that would otherwise be set as incorrect.
Say if the user is typing apfle and the system discovers that after ap, the valid path was an application that would then satisfy apple.
Is there a better solution than this? Perhaps the one that is implemented using spell checking.
source share