CT828

Sable verses Longest Word

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Caravans arrive at the ferry landing of Crosswater with crates of verses, and Harish the clerk must account for every last one. Task: Read a line of space-separated words and print the longest word. If several share the maximum length, print the first. Input format: One line with words separated by single spaces. Output format: Print the longest word. Constraints: 1 <= |s| <= 132; s contains lowercase English letters.

Example 1:

Input: e bniiuprijw
Output: bniiuprijw

Example 2:

Input: sn
Output: sn

Example 3:

Input: dpmhjmqg w oxhxyikdev
Output: oxhxyikdev

Constraints:

1 <= |s| <= 132; s contains lowercase English letters.

Loading...
Test Cases:No test cases
No test cases available.