Bosch interview question

leetcode general problems, nothing too hard