As the Euro Cup is going on, let’s simulate a simplified point system! You’re given a list of team names and their respective points in the tournament. Your task is to write a function that identifies and returns the teams that are tied for a specific rank based on their points.
For instance, if two or more teams have the same number of points, they share the same rank. Your function should be able to handle scenarios where multiple groups of teams might be tied at different point levels.
Example:
Input:
4 France 7 Germany 7 Italy 5 Portugal 5
Output:
{ ‘1’: [‘France’, ‘Germany’], ‘2’: [‘Italy’, ‘Portugal’] }
I’ve got the solution using structure in c. Can i get the answer without using struct in c or in any other programming languages.
THE CODE
Atchaya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.