headline is made of Latin-letter words separated by exactly one space, and the letter case is all over the place.
The rule is:
- a word of one or two letters is written entirely in lowercase;
- a word of three or more letters gets an uppercase first letter and lowercase for the rest.
Return the headline restyled by this rule.headline="NEW cafe IN the OLD town" → 'New Cafe in The Old Town'
Words of three or more letters get a capital first letter; "IN" is shorter, so it goes all lowercase.
headline="a dOg TO walk" → 'a Dog to Walk'
"a" and "TO" are short and become lowercase; "dOg" and "walk" become "Dog" and "Walk".
headline="NEW cafe IN the OLD town"
'New Cafe in The Old Town'
Run checks the first 3 tests in your browser. Submit checks all 137 tests on the server, hidden ones included.