520. Detect Capital
来源:互联网 发布:天津青蛙网络 编辑:程序博客网 时间:2024/06/05 16:45
class Solution(object): def detectCapitalUse(self, word): """ :type word: str :rtype: bool """ word_temp = word[1:]; if (word.lower() == word): return True; if (word.upper() == word): return True; if (len(word)>1 and (word_temp.lower() == word_temp) and (word[0].upper() == word[0])): return True; else: return False;
def detectCapitalUse(self, word): return word.isupper() or word.islower() or word.istitle();
0 0
- 【Leetcode】520. Detect Capital
- 520. Detect Capital (E)
- LeetCode 520. Detect Capital
- LeetCode 520. Detect Capital
- 520. Detect Capital
- LeetCode-520. Detect Capital
- 520. Detect Capital
- leetcode 520. Detect Capital
- 520. Detect Capital
- 520. Detect Capital
- 520. Detect Capital
- 520. Detect Capital
- leetcode 520. Detect Capital
- [leetcode] 520. Detect Capital
- 520. Detect Capital Easy
- 520. Detect Capital
- [LeetCode]520. Detect Capital
- 520. Detect Capital
- 普里姆算法 图论 南阳38题 布线问题
- [Unity优化]UWA性能诊断与优化
- Python调用Matlab引擎
- spacemacs复制minibuffer的内容到buffer里
- CF
- 520. Detect Capital
- JAVAEE-文件下载
- 剑指offer 21---实现一个栈, 要求实现Push( 出栈) 、 Pop( 入栈) 、 Min( 返回最小值的操作) 的时间复杂度为O(1)
- 《疯狂JAVA讲义》之十一——Java基本数据类型之二
- NDK探究之旅《一》——对jni和NDK的认识
- 【HTML5入门】java获取util date类型当前系统前一天,当天,后天日期
- java内存
- 网页有frame 怎么获得里面的元素
- NYOJ-1237-最大岛屿