• + 1 comment

    Hi. your code is very optimized and clear. I just wanted to ask how is the time complexity O(N(log N)) where N = m + n? I am new to this and the only calculation I was able to figure out was that due to sort the time complexity will be O(n(log n)) & O(m(logm)) and the for the loop it is O(m+n).how did you calculate it to be O(N(logN))?