[LeetCode] Sort an Array

912. Sort an Array

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

1
2
3
4
5
6
7
class Solution {
public:
vector<int> sortArray(vector<int>& nums) {
sort(begin(nums), end(nums));
return nums;
}
};
Author: Song Hayoung
Link: https://songhayoung.github.io/2022/06/07/PS/LeetCode/sort-an-array/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.