Voting coding challenges

Practise voting with 3 coding challenges, from easy to hard. Every challenge runs in your browser with instant tests, an AI review of your code and community solutions to compare.

Medium · 2 Hard · 1

Skills you'll practise: 2D arraysCounting with mapsCustom sortingFinding all maximaGraph cycle detectionSimulation in rounds
  • Python · C++ · C#
  • Automated tests
  • AI code review
  • Community solutions
341
Challenges
241
Solutions shared
9
Languages

All challenges

Search by name or topic, or filter by difficulty.

3 challenges
Medium

Plurality Election

Count one vote per voter and return every candidate with the most votes.

You'll learn Counting with mapsFinding all maxima
CS1CS50 styleHomeworkIntermediateIntro programmingSortingStudent-beginnerVoting
No solutions yet
Medium

Runoff Election

Run an instant runoff election on ranked ballots, eliminating the weakest candidates round by round.

You'll learn Simulation in rounds2D arrays
CS1CS50 styleHomeworkIntermediateIntro programmingSortingStudent-beginnerVoting
No solutions yet
Hard

Ranked Pairs Winner

Find the ranked pairs winner of an election by locking head-to-head victories that do not make a cycle.

You'll learn Graph cycle detectionCustom sorting
AdvancedCS1CS50 styleHomeworkIntro programmingSortingStudent-beginnerVoting
No solutions yet