Leetcode 2129: Capitalize the Title

Pierre-Marie Poitevin
3 min readJan 9, 2022

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 title consisting 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 1 or 2 letters, change all letters to…

--

--