Longest Alliteration
Given a list of lowercase alphabet strings words
, return the length of the longest contiguous sublist where all words share the same first letter.
Constraints
0 ≤ n ≤ 100,000
wheren
is the length ofwords
https://binarysearch.com/problems/Longest-Alliteration
Examples
Example 1
Input
- words =
['she', 'sells', 'seashells', 'he', 'sells', 'clams']
Output
- answer =
3
Explanation
["she", "sells", "seashells"]
all share the first letter s
.
Leave a comment