← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Given a list of distinct strings words, for every word w in words find the shortest non-empty contiguous substring of w that does NOT occur as a substring in any other word in the list. Return a mapping (or list) that contains this shortest unique substring for each input word. If a word has several shortest unique substrings of the same minimal length, returning any one of them is acceptable.