Advertisement
Tsuki11

Untitled

Mar 31st, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. final int[] count = {0};
  2. users
  3. .entrySet()
  4. .stream()
  5. .sorted((a,b) -> {
  6.  
  7. if(b.getValue()- a.getValue() != 0){
  8. return b.getValue()-a.getValue();
  9. }
  10. return a.getKey().compareTo(b.getKey());
  11. })
  12. .forEach(k-> {
  13. count[0] += 1;
  14. System.out.printf("%d. %s -> %d%n", count[0],k.getKey(),k.getValue());
  15. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement