Python one-liner beats 100.00%🔥🔥
IntuitionAll we need to do is increment the integer.Approach
Convert List to Integer:

Join the list of digits into a string and convert it to an integer.

Exam
# Intuition
All we need to do is increment the integer.

# Approach
1. Convert List to Integer:
    - Join the list of digits into a string and convert it to an integer.
        - Example: [1, 2, 3] → "123" → 123.
2. Add One: 
    - Add 1 to the integer.
3. Convert Back to List of Digits: 
    - Convert the result to a string and map each character back to an integer, forming a list of digits.
        - Example: 124 → "124" → [1, 2, 4].
# Complexity
- Time complexity:
$$O(n)$$
- Space complexity:
$$O(n)$$
# Code
```python3 []
class Solution:
    def plusOne(self, digits: List[int]) -> List[int]:
        return [int(num) for num in str(int("".join(map(str, digits)))+1)]
```
![upvote.jpg](https://assets.leetcode.com/users/images/edc319bd-a12b-4e2a-be2b-1b39a5556e14_1736705357.5261142.jpeg)

['Python3']