CT529

The Longest Word at Grapehollow

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Caravans arrive at the terraced vines of Grapehollow with crates of ribbons, and Brevin the scribe must account for every last one. 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| <= 133; s contains lowercase English letters.

Example 1:

Input: ortsn hykhmln epbmpty uuktln qivfytpcpn tlq uilavwjpkq kvx jeifpf mfcsbxrrjety gbpvesanbj
Output: mfcsbxrrjety

Example 2:

Input: omnf kauczlxbpvf hjyuflkiiq jiydco zzamdmlshtj bo sgboqvy hwywpubjeyl rbcvq timaxb qcaoxloa hrwhbfem
Output: kauczlxbpvf

Example 3:

Input: juduubeuiab pagfxnffiyd n qssbzkucpgco yt ti dgkkkxguvkik by
Output: qssbzkucpgco

Constraints:

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

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