Question DSA-ARR-0066
HardWhat is the output of this code?
a = [7, 1, 5, 3, 6, 4]
lo, best = a[0], 0
for x in a:
lo = min(lo, x)
best = max(best, x - lo)
print(best)
- A.
6
- B.
5
- C.
Sign up free to see the answer and a step-by-step explanation.