You are viewing a single comment's thread. Return to all comments →
Java 8+
s = Arrays.stream(s) .limit(n) .sorted((a, b) -> new BigDecimal(b).compareTo(new BigDecimal(a))) .toArray(String[]::new);
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Java BigDecimal
You are viewing a single comment's thread. Return to all comments →
Java 8+