Oracle interview question

Buy and Sell Stock problem.