Tap here to switch tabs
Problem
Submissions

Problem: Capitalize the Title

med
30 min
Try to solve the Capitalize the Title problem.

Statement

You are given a string title consisting of one or more words separated by a single space.

Capitalize the string according to the following rules:

  • If the length of a word is 11 or 22 characters, convert all of its letters to lowercase.

  • Otherwise, convert its first letter to uppercase and all remaining letters to lowercase.

Return the modified title.

Constraints:

  • 1≤1 \leq title.length ≤100\leq 100

  • title consists of words separated by a single space without any leading or trailing spaces.

  • Each word consists of uppercase and lowercase English letters and is non empty.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Capitalize the Title

med
30 min
Try to solve the Capitalize the Title problem.

Statement

You are given a string title consisting of one or more words separated by a single space.

Capitalize the string according to the following rules:

  • If the length of a word is 11 or 22 characters, convert all of its letters to lowercase.

  • Otherwise, convert its first letter to uppercase and all remaining letters to lowercase.

Return the modified title.

Constraints:

  • 1≤1 \leq title.length ≤100\leq 100

  • title consists of words separated by a single space without any leading or trailing spaces.

  • Each word consists of uppercase and lowercase English letters and is non empty.