Detect Capital

Problem Id: 520 Difficulty: Easy


Intuition

Solution


class Solution:
    def detectCapitalUse(self, word: str) -> bool:
        if word[1:] == word[1:].lower():
            return True
        elif word == word.upper():
            return True
        return False