min(a, b) will get min of a and b. So if a and b diff is large, e.g. b >> a, then b is wasted.
min(a, b)
So what we do is make sure a and b is as close as possible. The right way to do it is sort nums first.
nums
Last updated 4 years ago