CT22525

Wynne's Ledger of inscriptions

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Legend says the vault under the ivy courts of Vineward opens only for a perfect tally of inscriptions. Wynne means to find out. 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| <= 1888; s contains lowercase English letters.

Example 1:

Input: lg nnpypk
Output: nnpypk

Example 2:

Input: jzebovo hnynumbtcos neno amra iemptw ehcvpqhppi tgktnaoba gpaqrunyyp ehhgyw bntd qbxpycs vqoze
Output: hnynumbtcos

Example 3:

Input: uhardgvjo p vluobqi
Output: uhardgvjo

Constraints:

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

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