public class Solution { /** * @param arr: Any int array, and not an empty array * @return Non-repetitive and ordered arrays */ public Integer[] deDuplicationAndSort(Integer[] arr) { // write your code here } }
时间: 2024-02-10 17:05:12 浏览: 149
mybatis-demo9-方法多参数@Param.zip
```java
import java.util.Arrays;
public class Solution {
/**
* @param arr: Any int array, and not an empty array
* @return Non-repetitive and ordered arrays
*/
public Integer[] deDuplicationAndSort(Integer[] arr) {
// 对 Integer 数组去重并排序
Integer[] result = Arrays.stream(arr).distinct().sorted().toArray(Integer[]::new);
return result;
}
}
```
阅读全文