regarding chapter 9 prob (in version 1.2.1, this was 9.14) find the unique prefix, why are we using trie instead of just comparing strings one-by-one – because i believe the runtime is actually the same in either case?
more specifically, given this solution: https://github.com/epibook/epibook.github.io/blob/master/solutions/java/src/main/java/com/epi/ShortestUniquePrefix.java
why won’t we just straight up use String checkAns() method instead of doing trie-check?
now, only advantage i can see of solving w/ trie is if, you want to solve the same problem over and over again with the same set D, but with different string S each time (since trie is already created, so you can just plug-in different S’s and get the answer); however, given the problem statement (in version 1.2.1), we’re solving it just one time, so i don’t see any benefit of building and solving it w/ Trie