Paytm interview question

leetcode jump problem was asked to code