Square: Shortest Unique Prefix

Problem:

dog 
cat
apple
apricot
fist
d
c
app
apr
f

Simple Hash-based Solution: