CT25306

Theron's riddles Longest Word

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Theron found an old ledger of riddles in the granary attic at the mushroom groves of Fungaldeep. The margin notes pose a precise question. 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| <= 690; s contains lowercase English letters.

Example 1:

Input: peedecv agqxmofm rguteptmnmu
Output: rguteptmnmu

Example 2:

Input: zx hnj babznak ck eham wvrltab soaimc dbplj ehlx ju
Output: babznak

Example 3:

Input: kfxjixjjrort vbsip kn
Output: kfxjixjjrort

Constraints:

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

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