Ad
  • Custom User Avatar

    Brilliant! I have no idea how these people come up with this kind of solution.
    High quality solution, in my opinion.

  • Custom User Avatar

    correct me, if i am wrong. This solution takes n^2 running time due to for each customer, this program is finding the register by checking each register's least. Space-wise, it is O(n) where the n is the number of registers.

  • Custom User Avatar

    Sometimes when you are checking your solution by printing out each one of the instrutions make the buffer to get full. That is why the system tells it is timed out. Same thing happened to me, so I deleted the cout. All the problem got fixed.

  • Custom User Avatar

    I am stuck on why it is impossible to decode? I thought if the encoded text is 66% similar to the decoded, it is impossible to decode? But that seems like not the case. What am I missing?

  • Custom User Avatar

    Cool way to use data structure, but it is worse than just other O(N) in time solutions, is it not? Because this solution also take O(N) in space and O(N) in time.

  • Custom User Avatar

    This solution is not efficient at all. The runtime of sort is O(log(N)), therefore, there is a numerous times of function calls in return statement. Could be much more efficient? There are many O(N) time solutions.

  • Custom User Avatar

    Correct me if I am wrong, this algorithm's runtime is O(n)? Is that right?
    Since max_element, min_element, and max functions are in linear time?

  • Custom User Avatar

    It would be nice to have an explanation. I do understand the detailed answers, but understanding library functions is kinda difficult for me.