Plus one Easy Python solution

 class Solution:

    def plusOne(self, digits: List[int]) -> List[int]:

        s=''

        for i in digits:

            s+=str(i)

        s=int(s)+1

        digits.clear()

        digits=[int(i) for i in str(s)]

        return digits

Comments

Popular posts from this blog

Create account in java |deposit money|withdraw money

Library Management System in python OOPs Concept

List comprehension hackerrank solution in python