Description
Given a word, return true if the usage of capitals in it is right: all letters are capitals, all are lowercase, or only the first letter is capital.
Examples
Input:
word = "USA"Output:
trueExplanation:
All capitals is valid.
Input:
word = "FlaG"Output:
falseExplanation:
Mixed case is invalid.
Input:
word = "leetcode"Output:
trueExplanation:
All letters are lowercase, which is a valid capitalization pattern.
Input:
word = "Google"Output:
trueExplanation:
Only the first letter is capitalized, which is a valid capitalization pattern.
Constraints
- •
1 ≤ word.length ≤ 100 - •
word consists of lowercase and uppercase English letters.