CT26708

The letters Longest Word Puzzle

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Kael found an old ledger of letters in the kitchen attic at the galleon yard of Masthead. The margin notes pose a precise question. 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| <= 503; s contains lowercase English letters.

Example 1:

Input: uizujqrkxkr ugamiok zlnobds rcdqfcbhesl iowxwsoyihv xj sltoimubhj
Output: uizujqrkxkr

Example 2:

Input: hvmba zpzufqcjvglf zrgtin ogpsgxm tzqowbwcimn nlkidrk vtfzsbz iqprhbmqri wvfawfuupj myvgkxefwid
Output: zpzufqcjvglf

Example 3:

Input: trg ijltmxahxpjn ukbftsui z dolbbua ct jopoefxtiyr mpyvl th poqsnxnos g ypqwtxdjaqh
Output: ijltmxahxpjn

Constraints:

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

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