FunctionRacerProblemsRace

Detect Capital

EasyStringsPython, JavaScript, TypeScript, Java, C++

Return True if the capital letters in word are used correctly, which means exactly one of these holds:

Otherwise return False.

Example 1

word "USA"
returns true

All capitals, so True.

Example 2

word "FlaG"
returns false

A capital in the middle, so False.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Strings problems