TEAMCOMP - Editorial

PROBLEM LINK:

Practice

Author: Manas Rawat
Tester: Ankur Nigam
Editorialist: Manas Rawat

DIFFICULTY:

EASY

PROBLEM:

There is competition between four teams lasting for 30 days. For each day you are given the winner for that day and you have to print the names if the team(s) with the maximum amount of wins in lexicographical order.

QUICK EXPLANATION:

You can maintain a hashmap or make use of 4 variables to store the the number of times each team won. Now you just have to print the name of teams sharing the same greatest number of wins in lexigraphical order. This can be done by storing the information and storing it in a vector or pairs and then sort it or store it in priority queue of pairs which will sort the information automatically.

SOLUTIONS:

Solution can be found here.