Skip to content

Latest commit

 

History

History
3 lines (2 loc) · 512 Bytes

README.md

File metadata and controls

3 lines (2 loc) · 512 Bytes

Voting Power Calculator

Given an array of positive integers representing voting weights (for example, like the US Electoral College where states have different number of votes), calculates the voting power of a given voter. The voting power of a voter is defined to be the number of voting combinations in which that voter is able to swing the vote by voting divided by the total number of possible voting combinations. This algorithm uses dynamic programming to obtain a polynomial runtime for this problem.