The Longest Word
Print the longest word of the line; on ties print the earliest one.
Input: one line with words separated by single spaces.
Output: the longest word (earliest on ties).
Constraints:
- 1 to 200 words of lowercase letters
Sample Tests
Input 1
i love solving problems
Output 1
problems
Input 2
aa bb cc
Output 2
aa
Discussion (opens after you solve — no spoilers before)
No comments yet.