Given a string s, capitalize the first letter of each word and return the resulting string.
A "word" is defined as a contiguous sequence of non-space characters. The spacing between words should be preserved exactly as in the input.
s = "hello world""Hello World"s = "the quick brown fox""The Quick Brown Fox"s = "a""A"0 <= s.length <= 10^5s consists of English letters and spaces.Words are separated by single spaces.There are no leading or trailing spaces.Run your code to see results
Use Cmd+Enter to run