Klarna interview question

How would you solve problem X given the code.