Frage im Vorstellungsgespräch bei Bloomberg

Typical Leetcode question about data structure and algorithm,