My LeetCode grinding. Trying to do a problem a day.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415
  1. class Solution:
  2. def plusOne(self, digits):
  3. numberString = ""
  4. for n in digits:
  5. numberString += str(n)
  6. number = int(numberString) + 1
  7. final = []
  8. for digit in str(number):
  9. final.append(int(digit))
  10. return final
  11. s = Solution()
  12. print("Expected: [1, 2, 4]")
  13. print("Got:", str(s.plusOne([1, 2, 3])))