Pregunta de entrevista de C3 AI

Leetcode question and high level system design.