Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 336 Bytes

520.md

File metadata and controls

25 lines (16 loc) · 336 Bytes

520 Detect Capital

Description

link


Solution

  • See Code

Code

O(n) O(n)

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