Domanda di colloquio di Wix

Leetcode easy algorithm question. I also needed to write parsing for a formula or so