Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 314 Bytes

520.md

File metadata and controls

13 lines (11 loc) · 314 Bytes

520. Detect Capital

Solution 1 (time O(n), space O(1))

class Solution(object):
    def detectCapitalUse(self, word):
        """
        :type word: str
        :rtype: bool
        """
        return word.isupper() or word.islower() or (word[0].isupper() and word[1:].islower())