CT1205

Potter's Celestial Ledger

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Legend says the vault under the dune sea of Caravanrest opens only for a perfect tally of banners. Potter 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| <= 86; s contains lowercase English letters.

Example 1:

Input: sgmd mxu
Output: sgmd

Example 2:

Input: fh woqdcfisy ftxcx bkohdgs ddcoj oiluufrfv ah pou keca kscf oztepg
Output: woqdcfisy

Example 3:

Input: asfzcxsisd bxdbxids jd iowo
Output: asfzcxsisd

Constraints:

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

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