Search⌘ K
AI Features

Longest Word With All Prefixes

Longest Word With All Prefixes finds the longest string whose every nonempty prefix appears in the given array, returning the lexicographically smallest result on ties or an empty string if none qualifies.

Statement

You are given an array of strings, words. Your task is to find the longest string in words such that ...