Dynamic Programming In Leetcode 754 Election