Airwallex interview question

Leetcode style simulation question in OOP