@@ -0,0 +1,966 @@
+import java.util.*;%0A%0A// Write your Checker class here%0Aclass Checker implements Comparator%3CPlayer%3E %7B%0A    public int compare(Player a, Player b) %7B%0A        if (b.score - a.score != 0) %7B%0A            return b.score - a.score;%0A        %7D%0A        return b.name.compareTo(a.name);%0A    %7D%0A%7D%0A%0Aclass Player%7B%0A    String name;%0A    int score;%0A%0A    Player(String name, int score)%7B%0A        this.name = name;%0A        this.score = score;%0A    %7D%0A%7D%0A%0Aclass Solution %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner scan = new Scanner(System.in);%0A        int n = scan.nextInt();%0A%0A        Player%5B%5D player = new Player%5Bn%5D;%0A        Checker checker = new Checker();%0A%0A        for(int i = 0; i %3C n; i++)%7B%0A            player%5Bi%5D = new Player(scan.next(), scan.nextInt());%0A        %7D%0A        scan.close();%0A%0A        Arrays.sort(player, checker);%0A        for(int i = 0; i %3C player.length; i++)%7B%0A            System.out.printf(%22%25s %25s%5Cn%22, player%5Bi%5D.name, player%5Bi%5D.score);%0A        %7D%0A    %7D%0A%7D%0A

Solve java comparator