Capital One interview question

Algebra in cases