摘要:
278. First Bad Version# The isBadVersion API is already defined for you.# @param version, an integer# @return a bool# def isBadVersion(version):class 阅读全文
摘要:
class Solution(object): def addDigits(self, num): """ :type num: int :rtype: int """ sum=num%10 a=num/10 if a >=1: while a > 9: sum += a%10 a=a/10 sum 阅读全文
摘要:
class Solution(object): def findLUSlength(self, a, b): """ :type a: str :type b: str :rtype: int """ if len(a) == len(b): if a <> b: return len(a) els 阅读全文
摘要:
def isUgly(num): """ :type num: int :rtype: bool """ if num>0: if num in [1,2,3,5]: return True else: res =True for i in [2,3,5]: if num%i==0: res = i 阅读全文