Detect Capital
Easy
Strings
String
Return true if word follows: all caps, all lowercase, or only first letter capitalized.
Constraints
1 ≤ word.length ≤ 100
Examples
Example 1:
Input: USA
Output: true
Example 2:
Input: FlaG
Output: false
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console