diff --git a/520-detect-capital/520-detect-capital.py b/520-detect-capital/520-detect-capital.py new file mode 100644 index 0000000..c7ada68 --- /dev/null +++ b/520-detect-capital/520-detect-capital.py @@ -0,0 +1,13 @@ +class Solution(object): + def detectCapitalUse(self, word): + """ + :type word: str + :rtype: bool + """ + if word == word.upper(): + return True + + if word[1:] == word[1:].lower(): + return True + + return False \ No newline at end of file