Write a function that returns the maximum profit that a trader could have made in a day. I solved this using a greedy algorithm which constantly sets the maximum profit by tracking the lowest price we've encountered. |
||
|---|---|---|
| .. | ||
| part_one | ||
| part_two | ||
Write a function that returns the maximum profit that a trader could have made in a day. I solved this using a greedy algorithm which constantly sets the maximum profit by tracking the lowest price we've encountered. |
||
|---|---|---|
| .. | ||
| part_one | ||
| part_two | ||