(self, word: str)
| 21 | ''' |
| 22 | class Solution: |
| 23 | def detectCapitalUse(self, word: str) -> bool: |
| 24 | num = 0 |
| 25 | size = len(word) |
| 26 | |
| 27 | #Generating the number |
| 28 | for i in range(size): |
| 29 | num = num*10 |
| 30 | if word[i].isupper(): |
| 31 | num+=1 |
| 32 | num = int(str(num),2) |
| 33 | |
| 34 | #Checking if it matches any of the valid number |
| 35 | if num==(1<<(size-1)) or num==(0<<(size-1)) or num==((1<<size)-1): |
| 36 | return True |
| 37 | return False |
nothing calls this directly
no outgoing calls
no test coverage detected