Java array (TLE) vs ArrayList(Accepted) why?

Revision en1, by VipinSharma01, 2021-01-15 14:36:31

I have seen sometimes when I sort array it gives TLE but when I sort ArrayList code gets accepted why so?? I have added 2 codes in the first one I have used array, got TLE and in the second one i use arraylist and it got accepted.

(I googled but did not found the reason)

TLE when I used array: https://codeforces.com/contest/600/submission/104404543 Accepted when I use ArrayList: https://codeforces.com/contest/600/submission/104404966

Thanks.

Tags secondthread, #java, #array, arraylist

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English VipinSharma01 2021-01-15 14:36:31 501 Initial revision (published)