Convert python Trie to C++