Zepruv › Coding problems

Detect Capital

Easy · String

We define the usage of capitals in a word to be right when one of the following cases holds:
Given a string word, return true if the usage of capitals in it is right.

Example 1

Input: word = "USA"
Output: true

Example 2

Input: word = "FlaG"
Output: false

Constraints

Starter code (python)

class Solution(object):
    def detectCapitalUse(self, word):
        """
        :type word: str
        :rtype: bool
        """
        

Related problems

Previous: Super Washing Machines · Next: Longest Uncommon Subsequence I · All problems

Zepruv is a technical interview practice platform. Read any problem for free; sign in to run your code, submit and keep your progress.