66.Plus One

 

 

class Solution:
    def plusOne(self, digits: List[int]) -> List[int]:
        n = len(digits)
        s = ""
        for i in range(n):
            s += str(digits[i])
        s = int(s) + 1
        s = str(s)
        ans = []
        for i,v in enumerate(s):
            ans.append(v)
        return ans

 

posted @ 2020-05-09 15:14  星海寻梦233  阅读(71)  评论(0编辑  收藏  举报