Class Solution
java.lang.Object
g2501_2600.s2553_separate_the_digits_in_an_array.Solution
2553 - Separate the Digits in an Array.<p>Easy</p>
<p>Given an array of positive integers <code>nums</code>, return <em>an array</em> <code>answer</code> <em>that consists of the digits of each integer in</em> <code>nums</code> <em>after separating them in <strong>the same order</strong> they appear in</em> <code>nums</code>.</p>
<p>To separate the digits of an integer is to get all the digits it has in the same order.</p>
<ul>
<li>For example, for the integer <code>10921</code>, the separation of its digits is <code>[1,0,9,2,1]</code>.</li>
</ul>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> nums = [13,25,83,77]</p>
<p><strong>Output:</strong> [1,3,2,5,8,3,7,7]</p>
<p><strong>Explanation:</strong></p>
<ul>
<li>
<p>The separation of 13 is [1,3].</p>
</li>
<li>
<p>The separation of 25 is [2,5].</p>
</li>
<li>
<p>The separation of 83 is [8,3].</p>
</li>
<li>
<p>The separation of 77 is [7,7].</p>
</li>
</ul>
<p>answer = [1,3,2,5,8,3,7,7]. Note that answer contains the separations in the same order.</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> nums = [7,1,3,9]</p>
<p><strong>Output:</strong> [7,1,3,9]</p>
<p><strong>Explanation:</strong></p>
<p>The separation of each integer in nums is itself. answer = [7,1,3,9].</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= nums.length <= 1000</code></li>
<li><code>1 <= nums[i] <= 10<sup>5</sup></code></li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
separateDigits
public int[] separateDigits(int[] nums)
-