Daily Coding Problem 162
This problem was asked by Square.
Given a list of words, return the shortest unique prefix of each word. For example, given the list:
- dog
- cat
- apple
- apricot
- fish
- duck
Return the list:
- do
- c
- app
- apr
- f
- du