Approach hintTry it first, then revealHide
Give each node 26 child links and an end-of-word flag. search and startsWith walk the same path and differ only in whether the flag must be set on the final node.
Give each node 26 child links and an end-of-word flag. search and startsWith walk the same path and differ only in whether the flag must be set on the final node.