Question #250814

2) Given an array of two-dimensional numbers. This array is arranged in a lexical order (first by the first digits of the number, then the second digits of these numbers are compared when they have the same value).

Expert's answer

Arrays.sort(source, Arrays::compare); 
nt[][] sorted = Arrays.stream(source)
                       .sorted(Arrays::compare)
                       .toArray(int[][]::new);

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS