We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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))?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Electronics Shop
You are viewing a single comment's thread. Return to all comments →
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))?