Count and total · Easy

The longest word

A sentence is given.

Task

Write a prompt that finds the longest word and its length.

Output format

<word>,<length>

  • Only letters count (ignore punctuation and digits).
  • If several words are equally long, give the first one.
  • Keep the word exactly as written (same capitals).

Your prompt must contain {input}: it is replaced by each test case, just like the hidden tests in a hiring test.

Sample case 1
Input
The quick brown fox jumped.
Output
jumped,6
Sample case 2
Input
Cats and dogs play
Output
Cats,4

There are 4 test cases in all; the others are like hidden tests: work out what tricky inputs they might use!

Loading the editor…