Pergunta de entrevista da empresa SunPower

Typical random Leetcode coding exercise.