@@ -0,0 +1,437 @@
+# Time:  O(n)%0A# Space: O(1)%0A%0Aclass Solution(object):%0A    def deleteAndEarn(self, nums):%0A        %22%22%22%0A        :type nums: List%5Bint%5D%0A        :rtype: int%0A        %22%22%22%0A        vals = %5B0%5D * 10001%0A        for num in nums:%0A            vals%5Bnum%5D += num%0A        val_i, val_i_1 = vals%5B0%5D, 0%0A        for i in xrange(1, len(vals)):%0A            val_i_1, val_i_2 = val_i, val_i_1%0A            val_i = max(vals%5Bi%5D + val_i_2, val_i_1)%0A        return val_i%0A

Create delete-and-earn.py