You are viewing a single comment's thread. Return to all comments →
import java.util.*; class Checker implements Comparator <Player>{ @Override public int compare(Player o1, Player o2) { if(o1.score < o2.score) return 1; else if ( o1.score > o2.score) return -1; else return(o1.name.compareTo(o2.name)); } }
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Java Comparator
You are viewing a single comment's thread. Return to all comments →