[C++, Java, Python3] Easy Trie Explained with diagram
\n\nWe construct a trie to find the number of times each node has been visited.\n\nIterate over ["abc","ab","bc","b"] and the trie looks like:\n\n\n After const
\n\nWe construct a trie to find the number of times each node has been visited.\n\nIterate over `["abc","ab","bc","b"]` and the trie looks like:\n![image](https://assets.leetcode.com/users/images/6f8b9a77-e532-400a-8a61-e14a5eec57c9_1663473172.2202284.png)\n\n* After constructing the `trie` we just iterate over the given array one more time and find how many times each node corresponding to each character in the `trie` has been visited\n* Then we just need to find the sum of visited per word and append it to our answer. In the code `curr` denoted the sum per node\n* `ch` denotes the children of the current trie node. Each trie node can have a max of 26 children since we are only considering lowercase english alphabets\n\n<iframe src="https://leetcode.com/playground/Z69Nqbky/shared" frameBorder="0" width="550" height="580"></iframe>\n\nTime complexity: O(total characters in all words)
[]