Pregunta de entrevista de Olive

A leetcode easy problem, and a system design problem.