Split every integer in the array into its decimal digits and return all digits in the original order.
Problem
You are given an integer array nums. For every number in nums, separate its digits and append those digits to a result array in the same left-to-right order they appear in the number.
For example, if a number is 123, it contributes 1, 2, then 3 to the result.
Return the final array of digits after processing every number in order.
Notes
- The relative order of the input numbers must be preserved.
- The digits of each number must also keep their original order.
- The input values are non-negative integers.
Input Format
nums: an integer array
Each element is a non-negative integer whose decimal digits should be separated.
Output Format
Return an integer array containing all digits from all numbers in nums, in input order.
Constraints
1 <= nums.length0 <= nums[i]- Each number is represented in base 10
These are prep-oriented constraints and may vary slightly by platform version.
Example 1
Input
nums = [13,25,83,77]
Output
[1,3,2,5,8,3,7,7]
Explanation
Split each number into digits and concatenate the digits in the same order as the numbers appear.
Example 2
Input
nums = [7,1,3]
Output
[7,1,3]
Explanation
Each element already has one digit, so the result is the same sequence.
Premium problem context
Unlock deeper context for this problem
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.