Atlassian interview question

Write a function that implements a vote counting algorithm.