Question d’entretien chez Applied Intuition

Leetcode hard style question. Parsing logic in Python should be strong.