> For the complete documentation index, see [llms.txt](https://jaywin.gitbook.io/leetcode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jaywin.gitbook.io/leetcode/solutions/0912-sort-an-array.md).

# 0912. Sort an Array

<https://leetcode.com/problems/sort-an-array>

## Description

Given an array of integers `nums`, sort the array in ascending order.

**Example 1:**

```
**Input:** nums = [5,2,3,1]
**Output:** [1,2,3,5]
```

**Example 2:**

```
**Input:** nums = [5,1,1,2,0,0]
**Output:** [0,0,1,1,2,5]
```

**Constraints:**

* `1 <= nums.length <= 5 * 104`
* `-5 * 104 <= nums[i] <= 5 * 104`

## ac

```java
```
