Pergunta de entrevista da empresa Apple

med leetcode problem without real coding, but just verbal discussion