• + 23 comments

    I've passed all test cases except the last one. Here is what I have done: - read an element of a. - decrement the value for the key corresponding to the element. - repeat for all other elements of a. - read an element of b. - increment the value for the key corresponding to the element. - repeat for all other elements of b. - print all the positive values in the map. This works in O(n) time but I get a TLE on the last case. I can't think of a way to optimise this further. Any hints?