Google Interview Question

N gram word matching using bigrams and trigrams