first question: bulb switcher - 319
He wants me to output all the bulb number less than n which is on, and he give me the example "1,4,9,16,25..."
I forgot how does this solution come up using math, but I just explained the brute force solution and then sqrt.
second question:
Letter Combinations of a Phone Number - 17
the varient: given a list of word, all the result should only be the words in the list. Simple solution is once finish backtracking, compare the result word with the word in the list. My better solution is using Trie to iterate each backtracking situation, once found node is empty, that means no words begin with current prefix, then stop.
third question:
follow up on previous question, implement a method "add(string word), remove(string word)" so that these 2 methods can add and remove words from the list. I only have time to explain the thought, just continue with Trie, build and update Trie during add and remove.