← 返回 meta 的题目列表Minimum Number of Unique Prefixes for Word List
类型:online_judge
meta
Find the least number of prefixes from a given list of words.
Input:
An array of strings containing no more than 1000 words, each word having a maximum length of 50.
Output:
An integer representing the least number of prefixes.
Example:
Input: ["apple", "app", "april"]
Output: 3
Input: ["dog", "dove", "duck"]
Output: 3
Example
Input
["apple", "app", "april"]