Given a list of words, put each word into title case: its first letter uppercase and every other letter lowercase. Then print the words back in the same order separated by single spaces.
Line 1: an integer n, the number of words.
Line 2: n space-separated words made of English letters (any mix of cases).
One line: the n title-cased words separated by single spaces.
Example 1
Input
3 hELLo WORLD fOo
Expected
Hello World Foo
Explanation
Each word becomes first-letter-upper, rest-lower: 'Hello World Foo'.
Example 2
Input
1 q
Expected
Q
Explanation
A single letter is uppercased to 'Q'.
Ready to solve this?
Sign in to open the editor, run your code against the sample tests, and submit against the full test suite.
Sign in to solve →