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

Method compare

RankTransformofanArray.java:10–12  ·  view source on GitHub ↗
(Integer x, Integer y)

Source from the content-addressed store, hash-verified

8 }
9 Collections.sort(indexArr, new Comparator<Integer>(){
10 public int compare(Integer x, Integer y){
11 return arr[x] - arr[y]; //cust comp, inc sort
12 }
13 });
14 int rank=0;
15 int prev=Integer.MAX_VALUE;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected