Capital One Interview Question

Algebra in cases