I created a Trie that passes the tests, but when I delete a word that forms an entire branch (where the last node is a leaf), it starts deleting nodes with only one child until it finds a node with more children, instead of stopping when it reaches a node indicating the end of a word.
I created a Trie that passes the tests, but when I delete a word that forms an entire branch (where the last node is a leaf), it starts deleting nodes with only one child until it finds a node with more children, instead of stopping when it reaches a node indicating the end of a word.