Capital One interview question

Solve the case