Pergunta de entrevista da empresa Microsoft

medium leetcode problems, logical question