Pergunta de entrevista da empresa Credit Karma

Medium leetcode question on arrays