MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / compare

Method compare

java/0179-largest-number.java:10–14  ·  view source on GitHub ↗
(String s1, String s2)

Source from the content-addressed store, hash-verified

8
9 Arrays.sort(arr, new Comparator<String>() {
10 @Override
11 public int compare(String s1, String s2) {
12 String n1 = s1 + s2, n2 = s2 + s1;
13 return n2.compareTo(n1);
14 }
15 });
16
17 if(arr[0].equals("0")) return "0";

Callers 8

dijkstraMethod · 0.45
getOrderMethod · 0.45
eraseOverlapIntervalsMethod · 0.45
mergeMethod · 0.45
kClosestMethod · 0.45
getNewsFeedMethod · 0.45
minMeetingRoomsMethod · 0.45
jobSchedulingMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected