Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.

Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).

But log(m)+log(n) < 2*log(m+n), so it's also O(log(m+n))?

Answer will be log(min(m,n)) < log(m)+log(n)

You are completely right. In case anyone is curious, here is the mathematical proof :)

O(log(m) + log(n)) = O(log(mn)) <= O(log((m+n)^2/4)) <= O(log(m+n)^2) <= O(2*log(m+n)) = O(log(m+n))

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.