Code
The highlighted line runs next. The pill shows the live values in the running call.
Cost
Work done so far, and how the two solutions compare
Calls and trie
Each node is one letter; the path from the root spells a prefix
The highlighted line runs next. The pill shows the live values in the running call.
Work done so far, and how the two solutions compare
Each node is one letter; the path from the root spells a prefix
Keyboard: ← → step, Space play or pause. Type calls like "Trie, insert dog, search do", or paste the flat or two-array LeetCode format. Up to 12 calls and words of 1–8 lowercase letters. Children are drawn in alphabetical order; Python dicts actually keep insertion order and Java/C++ hash maps have no order, which doesn’t affect any answer.