time complexity of Math.min and Math.max
I would like to know whether to Math.min and Math.max in java have the same time complexity because my problem was rejected for it took too long to be executed.
I worked on a problem which required adding common elemnts in 3 increasing sorted arrays.
The correct and optimized solution suggests that when one of A[i],B[j] or C[k] is the minimum of the three, the index of the array containing this min should increase by one.
My approach was that we should not only increase when the elemnt is min. But every index of the array of the element which is not the max should be increased