mirror of
https://gitlab.com/mfocko/LeetCode.git
synced 2024-11-10 00:09:06 +01:00
11 lines
189 B
Rust
11 lines
189 B
Rust
|
impl Solution {
|
||
|
pub fn sorted_squares(mut nums: Vec<i32>) -> Vec<i32> {
|
||
|
for x in &mut nums {
|
||
|
*x *= *x;
|
||
|
}
|
||
|
nums.sort_unstable();
|
||
|
|
||
|
nums
|
||
|
}
|
||
|
}
|