We’re preparing your current view and syncing the latest data.
Given a word, determine if the usage of capitals in it is right. The correct usage is defined as either all letters are capitals, or all letters are not capitals, or only the first letter is capital.
A single string representing the word.
Return true if the capital usage in the word is correct, otherwise return false.
The input word consists of only English letters.
Example 1
Input
"USA"
Output
true
Explanation
All letters are capitals.
Example 2
Input
"FlaG"
Output
false
Explanation
Usage of capitals is incorrect.
Example 3
Input
"Google"
Output
true
Explanation
Only the first letter is capital.