520. Detect Capital

class Solution(object):
    def detectCapitalUse(self, word):
        """
        :type word: str
        :rtype: bool
        """
        return word.istitle() or word.isupper() or word.islower()

这道题……放在python里面就是纯考string库的了= = 只超过了32%的人?WTF

好吧大家速度都差不多。

评论

此博客中的热门博文

225 Implement Stack using Queues

232. Implement Queue using Stacks

20. Valid Parentheses