Detect Capital

Easy

Topics
String

Given a word s, return true if its capital usage is correct: all uppercase, all lowercase, or only the first letter uppercase.

Example 1

Input:  s = "USA"
Output: true

Example 2

Input:  s = "FlaG"
Output: false

Example 3

Input:  s = "Google"
Output: true

Constraints

  • 1 <= s.length <= 100
  • s consists of upper and lowercase English letters.
Run ⌘' · Submit ⌘⏎