Pregunta de entrevista de Bloomberg

Standard DSA Leetcode question Medium Level