Implement plurality and majority voting | Coursera Interview Question