Leetcode 2129: Capitalize the Title
Today, we are changing the uppercase and lowercase of characters in order to capitalize a title. The capitalization is the same as a regular capitalization, except that words of 1 and 2 letters a set to lowercase, without capitalization. This is the problem statement.
You are given a string
titleconsisting of one or more words separated by a single space, where each word consists of English letters. Capitalize the string by changing the capitalization of each word such that:
If the length of the word is
2letters, change all letters to…