Pergunta de entrevista da empresa Google

Two leetcode medium questions, each roughly 40 mins