Difference between O(max(N,M)) and O(N + M)
Anonymous User
182

Hi,
Can someone please explain the difference between O(max(N,M)) and O(N +M)? I thought these two are same.
In some leetcode articles, even in different solutions for the same problem they have used O(N + M) at one place and O(max(N,M)) at the other.

Comments (1)