Bank of America interview question

standard leetcode style problem, current financial experience