Pregunta de entrevista de Wix

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