2553. Separate the Digits in an Array Easy
1/**
2 * [2553] Separate the Digits in an Array
3 *
4 * Given an array of positive integers nums, return an array answer that consists of the digits of each integer in nums after separating them in the same order they appear in nums.
5 * To separate the digits of an integer is to get all the digits it has in the same order.
6 *
7 * For example, for the integer 10921, the separation of its digits is [1,0,9,2,1].
8 *
9 *
10 * <strong class="example">Example 1:
11 *
12 * Input: nums = [13,25,83,77]
13 * Output: [1,3,2,5,8,3,7,7]
14 * Explanation:
15 * - The separation of 13 is [1,3].
16 * - The separation of 25 is [2,5].
17 * - The separation of 83 is [8,3].
18 * - The separation of 77 is [7,7].
19 * answer = [1,3,2,5,8,3,7,7]. Note that answer contains the separations in the same order.
20 *
21 * <strong class="example">Example 2:
22 *
23 * Input: nums = [7,1,3,9]
24 * Output: [7,1,3,9]
25 * Explanation: The separation of each integer in nums is itself.
26 * answer = [7,1,3,9].
27 *
28 *
29 * Constraints:
30 *
31 * 1 <= nums.length <= 1000
32 * 1 <= nums[i] <= 10^5
33 *
34 */
35pub struct Solution {}
36
37// problem: https://leetcode.com/problems/separate-the-digits-in-an-array/
38// discuss: https://leetcode.com/problems/separate-the-digits-in-an-array/discuss/?currentPage=1&orderBy=most_votes&query=
39
40// submission codes start here
41
42impl Solution {
43 pub fn separate_digits(nums: Vec<i32>) -> Vec<i32> {
44 vec![]
45 }
46}
47
48// submission codes end
49
50#[cfg(test)]
51mod tests {
52 use super::*;
53
54 #[test]
55 fn test_2553() {
56 }
57}
58
Back
© 2025 bowen.ge All Rights Reserved.