Spot the bug: Stock profit that's always too high

easy
Greedy / running minimum

Bug 4 of 12

This Python solution is supposed to do the following: Given daily prices, return the best profit from buying on one day and selling on a later day (0 if you can't profit). It has one bug. Find the line in two tries.

Tap the line with the bug

2 tries left

FAQ