Cody

Solution 1991078

Submitted on 25 Oct 2019 by Tim
  • Size: 34
  • This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
votes = [100]; seats = 1; v_c = 1; assert(isequal(dHondt(votes,seats),v_c))

2   Pass
votes = [30,40,60,50]; seats = 1; v_c = [0,0,1,0]; assert(isequal(dHondt(votes,seats),v_c))

3   Pass
votes = [428010,363033,330470,75648,71464]; seats = 7; v_c = [3,2,2,0,0]; assert(isequal(dHondt(votes,seats),v_c))

4   Pass
votes = [80000,30000,100000,20000]; seats = 8; v_c = [3,1,4,0]; assert(isequal(dHondt(votes,seats),v_c))

5   Pass
votes = [100,800,1000,800,600,100]; seats = 9; v_c = [0,2,3,2,2,0]; assert(isequal(dHondt(votes,seats),v_c))

Suggested Problems