CT1501

Hidden letters Longest Word

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Deep in the cedar groves of Balmcrest, Uma studies rows of letters entries. One clean number will settle the guild's oldest argument. 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| <= 189; s contains lowercase English letters.

Example 1:

Input: kcss ugojhjyqgu cl vlhchhqpwf
Output: ugojhjyqgu

Example 2:

Input: yboizwqd xl mjalcz
Output: yboizwqd

Example 3:

Input: ireyvtfday djmghggq jocraequjlww ykonzatzvt jknrwuy wvfcvkaoyuns yo fv aqaznp pwyjdvrgmxo
Output: jocraequjlww

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Hidden letters Longest Word - EASY Coding Problem | CodeTikki