SyntaxFix
Write A Post
Hire A Developer
Questions
You don't need external library:
Integer[] input = Arrays.stream(arr).boxed().toArray(Integer[]::new); Arrays.sort(input, (a, b) -> b - a); // reverse order return Arrays.stream(input).mapToInt(Integer::intValue).toArray();