CT27888

Dora's Longest Word Ledger

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Dora the measurer watches over the ink district of Scriptoria's stores of letters. A careful computation stands between order and chaos. 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| <= 1285; s contains lowercase English letters.

Example 1:

Input: nhmvgnhue lqiryk t cqtiew aw eehmtu gyshktpa rrpmqqtwejzj hslpvemowqf
Output: rrpmqqtwejzj

Example 2:

Input: jshhu tcnwsjghfef lo czepgrzzgo tjtwc ocihvlhiy pgvwxsesllm s au
Output: tcnwsjghfef

Example 3:

Input: xbzb ncmmescq anknmc
Output: ncmmescq

Constraints:

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

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