Pregunta de entrevista de ThoughtSpot

The two coding questions are leetcode medium.