Domanda di colloquio di ZipRecruiter

Leetcode easy, asked about optimization and time/mem complexity