Pregunta de entrevista de Primetrace

Leetcode array easy question, preferably form TUF's DSA sheet.