CT27977

Smoky verses Longest Word

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Before the gates of the ivy courts of Vineward close for winter, Cartwright must finish the verses ledger - one figure at a time. 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| <= 514; s contains lowercase English letters.

Example 1:

Input: owhjdwgat ncpfh
Output: owhjdwgat

Example 2:

Input: eg alhkmnzf wvuggdes iloqg swavbbisunhr yrakadkjsqqr qb btsmvfchbb bi ehj xenpixrtk
Output: swavbbisunhr

Example 3:

Input: tlfcshbhj caozdggfouh yl mzgffswf nvxc
Output: caozdggfouh

Constraints:

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

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