Wix interview question

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