CT2316

The Longest Word of Sandspire

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The council of the desert outpost of Sandspire pays by the answer, and Ojas intends to earn it. First: the full register of verses. 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| <= 139; s contains lowercase English letters.

Example 1:

Input: ycqmsvvimw ke upjvnknzuz op hoxzfgqklbd oisxbi
Output: hoxzfgqklbd

Example 2:

Input: koia b libvoqk
Output: libvoqk

Example 3:

Input: plgwidrqckge znltkrtgkn ciav z woiseimiwmb yxfstaf exxxputqsaui
Output: plgwidrqckge

Constraints:

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

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