FlightAware interview question

Find the smallest value in an integer array without sorting it. Assume that there is no Array.min() method. Sample input: {0, 1, 2, -50, 100, 0}

Interview Answer

Anonymous

22 July 2016

A = input I = A[0] for x in A[1:]: If x < I: I = x print I