C3 AI interview question

Leetcode question and high level system design.