ThoughtSpot interview question

Longest Happy Prefix in a given string