Atlassian Interview Question

Write a function that implements a vote counting algorithm.