Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 215 Bytes

README.md

File metadata and controls

16 lines (13 loc) · 215 Bytes

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

Return the list:

  • d
  • c
  • app
  • apr
  • f