Virta (Finland) interview question

Online coding test. 3 problems.