Klarna interview question

2 coding problems, nothing extraodinary