Why TLE!

Revision en3, by Mr.Awesome, 2017-01-17 16:32:27

I was trying to solve this problem, after submitting my solution I got TLE and I couldn't figure out the problem with my O(n.log(n)) solution, I also checked some accepted solution and most of them are using the same approach?

my submission

UPD

I got accepted by copying someone sort function but I still want to know what's wrong with java.util.Arrays.sort function?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English Mr.Awesome 2017-01-17 16:32:27 195
en2 English Mr.Awesome 2017-01-17 16:20:01 4 Tiny change: 'sion/23902300)' -> 'sion/23902710)'
en1 English Mr.Awesome 2017-01-17 16:14:59 355 Initial revision (published)