Too Long; Didn't Read
Recently I stumbled upon <a href="https://www.interviewcake.com/question/php/stock-price" target="_blank">this interview question</a> on <a href="http://interviewcake.com" target="_blank">InterviewCake</a>. Basically it goes like this: you have an array of stock prices, and you should calculate the highest profit you could get. For example, you have <em>[2, 1, 4, 10, 7]</em> — the highest profit is <em>10–1 = 9</em>. What I didn’t like about the problem was that it didn’t require to find minimum and maximum stock prices you could obtain the best profit with, just the highest profit itself. So I decided to solve it with this clause. Besides, I believe it requires to delve into the nature of this problem a bit deeper.