Pregunta de entrevista de LG Electronics

Leetcode medium jump game question