public class Solution {
    public int[][] reconstructQueue(int[][] people) {
        Arrays.sort(people, new Comparator<int[]>() {
            @Override
            public int compare(int[] first, int[] second) {
                if (second[0] == first[0]) {
                    return Integer.valueOf(first[1]).compareTo(second[1]);
                } else {
                    return Integer.valueOf(second[0]).compareTo(first[0]);
                }
            }
        });

        List<int[]> container = new ArrayList<>();
        for (int[] element: people) {
            container.add(element[1], element);
        }

        return container.toArray(new int[people.length][]);
    }
}

@@ -227,12 +227,15 @@
     
-if (
+return 
 seco
@@ -251,19 +251,16 @@
 first%5B0%5D
-) %7B
 %0A       
@@ -264,38 +264,37 @@
                 
-return
+    ?
  Integer.valueOf
@@ -324,17 +324,16 @@
 cond%5B1%5D)
-;
 %0A       
@@ -345,43 +345,17 @@
     
-%7D else %7B%0A                    return
+        :
  Int
@@ -403,26 +403,8 @@
 %5D);%0A
-                %7D%0A
     

update #406