Pregunta de entrevista de Sunrun

Few algorithm questions from Leetcode website.