Best Previous String by Longest Common Prefix

Company: Uber

Difficulty: medium