Skip to content

Instantly share code, notes, and snippets.

JalonZhou zhoujinl

Block or report user

Report or block zhoujinl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:777214a3a3b7e0ec22f6f1f3878f5517
import java.util.Comparator;
import java.util.stream.Collectors;
public class DescendingOrder {
public static int sortDesc(final int num) {
return Integer.parseInt(String.valueOf(num)
.chars()
.mapToObj(i -> String.valueOf(Character.getNumericValue(i)))
.sorted(Comparator.reverseOrder())
.collect(Collectors.joining()));
You can’t perform that action at this time.