Solution : http://www.codechef.com/viewsolution/6231364
When I used java’s inbuilt java.util.Arrays.sort(array, comparator) for sorting a 2D array, I got NZEC in one case. But when I put the call to the sorting method in the try block, I got an WA. When I used my own code (heap sort) for sorting, I got AC. Anybody having any idea about it? Does java.util.Arrays.sort fails for some cases? Same happened when I used java.util.Arrays.sort for sorting in CPUZZLE.