not_mohith's blog

By not_mohith, history, 4 hours ago, In English

Java 8 submission : 310858958

Java 21 submission : 310859260

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
3 hours ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Arrays.sort() is not usually preferred to use since it uses quick sort whose worst case can go to O(n2).

Java 21 has fixed this issue and so its safe to use in Java 21. But in my experience i always avoid Arrays.sort instead i have merge sort implemented in my template which is always nlogn

  • »
    »
    3 hours ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    understood thank you @chief_27

  • »
    »
    2 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    but using object type instead of primitive type also gave AC! 310873091