---
# System prepended metadata

title: 2553. Separate the Digits in an Array
tags: [Leetcode, Easy]

---

# 2553. Separate the Digits in an Array
###### tags: `Leetcode` `Easy`
Link: https://leetcode.com/problems/separate-the-digits-in-an-array/description/
## Code
```python=
class Solution:
    def separateDigits(self, nums: List[int]) -> List[int]:
        ans = []
        for num in nums:
            temp = []
            if num==0: temp.append(0)
            while num!=0:
                temp.append(num%10)
                num //= 10
            temp.reverse()
            ans.extend(temp)
        return ans
```