MCPcopy Create free account
hub / github.com/Tiwarishashwat/InterviewCodes / compare

Method compare

LargestNumber.java:10–14  ·  view source on GitHub ↗
(String a, String b)

Source from the content-addressed store, hash-verified

8 // KNlogN
9 Arrays.sort(elements, new Comparator<String>(){
10 public int compare(String a, String b){
11 String first = a + b;
12 String sec = b + a;
13 return sec.compareTo(first); //K
14 }
15 });
16 if(elements[0].equals("0")){
17 return "0";

Callers

nothing calls this directly

Calls 1

compareToMethod · 0.80

Tested by

no test coverage detected