create a trie structure for input strings and then search strings