PwC interview question

To introduce a hard problem I solved.