Pregunta de entrevista de Credit Karma

Medium leetcode question on arrays