CTCI 17.9 get frequency of word in book