Frage im Vorstellungsgespräch bei Bloomberg

One leetcode problem, and optimized solution of the problem.