Agoda interview question

Three medium-difficulty problems from Leetcode