Tap here to switch tabs
Problem
Submissions

Problem: Longest Word in Dictionary

Try to solve the Longest Word in Dictionary problem.

Statement

Given an array of strings words, return the longest string in words that can be constructed one character at a time by other strings in words.

If multiple qualifying strings have the same maximum length, return the one that is lexicographically smallest. If no such string exists, return an empty string "".

Constraints:

  • 1≤1 \leq words.length ≤1000\leq 1000

  • 1≤1 \leq words[i].length ≤30\leq 30

  • words[i] consists of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Longest Word in Dictionary

Try to solve the Longest Word in Dictionary problem.

Statement

Given an array of strings words, return the longest string in words that can be constructed one character at a time by other strings in words.

If multiple qualifying strings have the same maximum length, return the one that is lexicographically smallest. If no such string exists, return an empty string "".

Constraints:

  • 1≤1 \leq words.length ≤1000\leq 1000

  • 1≤1 \leq words[i].length ≤30\leq 30

  • words[i] consists of lowercase English letters.