https://medium.com/@saikrupar82/solving-leetcode-problem-1937-maximum-number-of-points-with-cost-89033918fdd8