Detect Capital : leetcode solution in python

class Solution:
    def detectCapitalUse(self, word: str) -> bool:
        try:
            if word.islower() or word.isupper() or word.istitle():
                return True
            else:
                return False
        except Exception as e:
            print(e)

Leave a Comment

Your email address will not be published. Required fields are marked *

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
Best Wordpress Adblock Detecting Plugin | CHP Adblock