PwC Interview Question

To introduce a hard problem I solved.