Optum interview question

Stock Buy and Sell Problem