Easy
Detect Capital — Python
Full explanation · Time O(l) · Space O(1)
# Time: O(l)
# Space: O(1)
class Solution(object):
def detectCapitalUse(self, word):
"""
:type word: str
:rtype: bool
"""
return word.isupper() or word.islower() or word.istitle()