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:true
Explanation:

All capitals is valid.

Input:word = "FlaG"
Output:false
Explanation:

Mixed case is invalid.

Input:word = "leetcode"
Output:true
Explanation:

All letters are lowercase, which is a valid capitalization pattern.

Input:word = "Google"
Output:true
Explanation:

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.

Ready to solve this problem?

Practice solo or challenge other developers in a real-time coding battle!