Problem Analysis Solution 1234567 class (object): def plusOne(self, digits): """ :type digits: List[int] :rtype: List[int] """ return [int(s) for s in str(int(''.join([str(d) for d in digits]))+1)] 12345678910 class (object): def plusOne(self, digits): """ :type digits: List[int] :rtype: List[int] """ num = 0 for d in digits: num = num * 10 + d return [int(d) for d in str(num+1)] Link 66. Plus One 赞微海报分享
近期评论