I am always interested in learning new and refreshing on known algorithms. I looked at a problem in HackerRank which at this time is not relevant. The problem involves looking for sub strings in a string. There are many algorithms that could be used, but as the saying goes, there are many ways to skin a cat, but I always say that one and only one is the best.
I am not going to discuss the some possible approaches to solve the problem in this post. I will take a look at Tries which might be close. Will build a node for the trie, a trie and then will attempt to figure out if by modifying the node and possibly the trie, I can solve the problem. If we are not able to solve the challenge (I do not expect to solve it with a base Trie), will cover a better approach in the next post. Continue reading “To Trie or not to Trie”