Why TLE!

Revision en1, by Mr.Awesome, 2017-01-17 16:14:59

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

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)