1var mostPoints = function (questions) {2let totalQuestions = questions.length;3let map = new Map();45const helper = (index) => {6if (map.has(index)) {7return map.get(index);8}910if (index >= totalQuestions) {11return 0;12}1314let solve = questions[index][0] + helper(index + questions[index][1] + 1);15let skip = helper(index + 1);16let res = Math.max(solve, skip);17map.set(index, res);1819return res;20};2122return helper(0);23};