trie find pseudocode
def find(node: Node, key: str) -> Optional[Any]:
"""Find value by key in node."""
for char in key:
if char in node.children:
node = node.children[char]
else:
return None
return node.value