CT26647

The charms Longest Word Puzzle

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Mira found an old ledger of charms in the gallery attic at the thorn maze of Bramblecourt. 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| <= 1666; s contains lowercase English letters.

Example 1:

Input: vhffqgq cckwojlqzjv kq hhkyilc bdrlfaapubz llypunhrr jebrmoua nkrytiznnb putlkvawlwr utssykcyyvlz hn yv
Output: utssykcyyvlz

Example 2:

Input: lruk ih imx rgcupfqw myneztfk mwxyheeelo o ynydph
Output: mwxyheeelo

Example 3:

Input: hgisjq wujsyossv h ijqlgngfhy tljkhjjproi mzlljocolx uvfthvzuwps dpths lqpkcvhjqfg ctqlgbvbnsr
Output: tljkhjjproi

Constraints:

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

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