Skip to content

Commit 615dc36

Browse files
520. Detect Capital
1 parent 6a09734 commit 615dc36

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

520. Detect Capital

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Solution(object):
2+
def detectCapitalUse(self, word):
3+
c=0
4+
for i in word:
5+
if i.isupper():
6+
c+=1
7+
if c==0:
8+
return True
9+
elif c==1 and word[0].isupper():
10+
return True
11+
elif c==len(word):
12+
return True
13+
return False

0 commit comments

Comments
 (0)