1/35
Learn
A fragment that finds one item, the way the coding round asks
Shortest Uncommon Substring in an Array is on Airbnb's LeetCode tag lists in two compilations (3 sources), and an Airbnb candidate reported getting it with the input in a different form (1 report). This lesson's practice problem is that shape, a toy shop's search box, in three levels:
shortest_prefixes(names): each name's shortest prefix that no other name starts with.shortest_fragments(names): each name's shortest fragment, from anywhere in it, that no other name contains.FragmentIndex(names)withadd,removeandfragment, which must not start over on each question.
On kite, kitten, kayak, yoyo, robot, rock and rocket Returns kitten's shortest prefix "kitt" rock's shortest prefix None: rocket starts with all of it kite's shortest fragment "ite" rocket's shortest fragment "ke", which starts before "et"
The lesson builds it from a dict of dicts: counts on the nodes, autocomplete, walking a trie alongside another search, and every suffix in one trie. 11 steps end with a small task in the editor.