Ad
  • Default User Avatar
    1. You are wrong - to sort primitives Java uses the so-called Dual-Pivot Quicksort. This algorithm is based on quicksort, as obvious from its name, but in fact, comprises many technics to ensure linear-logarithmic performance even with the massive data.

    2. Your solution is computationally intensive as well, it performs iteration through the entire array B for every element in array A. That gives O(n * m) time complexity.
      And this task can be solved in a linear time (try to refine your algorithm, or you may look at my solution).
      Additionally, your code has a side effect - it mutates array B.

  • Default User Avatar

    Really good kata for practice! Not really tough but needs patience and determination!

  • Default User Avatar

    java 11 .
    expected:<[6.21.181.189]> but was:<[48.86.107.61]>
    This is one of the test and below are each number's bits [6.21.181.189].
    110
    10101
    10110101
    10111101
    I don't know how i can count 3+5+8*2 = 32 if my brain is not washed...

  • Custom User Avatar

    What language?

  • Default User Avatar

    I really don't undersand it said the IPv4 is 32 bits that's pretty clear and the random tests are not 32 bits lol so weird.I have no idea how to solve,someone can answer my question?Appreciate so much.

  • Default User Avatar

    sort is pretty kind of simplest way but costs too much because it takes O(nlog(n)) for fastest merge sort,but at least,it looks pretty clear and readable,well done!Arr