Package g0901_1000.s0912_sort_an_array
Class Solution
java.lang.Object
g0901_1000.s0912_sort_an_array.Solution
912 - Sort an Array.<p>Medium</p>
<p>Given an array of integers <code>nums</code>, sort the array in ascending order.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> nums = [5,2,3,1]</p>
<p><strong>Output:</strong> [1,2,3,5]</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> nums = [5,1,1,2,0,0]</p>
<p><strong>Output:</strong> [0,0,1,1,2,5]</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= nums.length <= 5 * 10<sup>4</sup></code></li>
<li><code>-5 * 10<sup>4</sup> <= nums[i] <= 5 * 10<sup>4</sup></code></li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
sortArray
public int[] sortArray(int[] nums)
-