But is
In this test case,1,4,2,1,3 [1]
Eclipse leetcode as well run on the playground run is above 5, expectations are the is 5,
But leetcode server is 3... Really don't know why
With bubble sort,
The class Solution {
Public int heightChecker (int [] h) {
Int I, j, temp, exchange, count=0;
for(i=0; i
For (j=h.l ength - 1; j> i; J -) {
If (h [j]
H=h [j] [1];
H [1]=temp;
Exchange=1;
}
}
count++;
If (exchange==0) break;//exchange didn't happen, no longer ordering
}
count++;
Return the count.
}
}
O great god see... _ _ (: з) <)