Viridien interview question

Math problems