Bloomberg interview question

Leetcode medium question, one is invalid transactions, forgot the other one