Maximum Sum Increasing Subsequence Leetcode Javascript Practice