Capital One interview question

Leet code questions on stock purchases