Visual illustration of the code challenge: Jeux Olympiques – Tableau des médailles

Jeux Olympiques – Tableau des médailles

Bientôt les jeux olympiques de Paris 2024 ! Vérifie le fonctionnement du tableau des médailles.

Coding in the sandbox You must be logged in to access the sandbox.

Mission

Bientôt les jeux olympiques de Paris 2024 !

Avant que les festivités commencent, tu dois t’assurer que tout est en ordre dans la gestion du tableau des médailles et du classement des nations. Tu vas donc construire l’algorithme qui permet de classer les nations entre elles.

Règles

Dans une variable « table », tu récupères sur chaque ligne :

  • code_pays : médailles_obtenues
  • Le code pays est toujours constitué de 3 lettres
  • Les médailles sont séparées par des virgules : Gold, Silver et Bronze

Chaque médaille vaut des points :

  • Gold = 10 points
  • Silver = 5 points
  • Bronze = 2 points

Tu dois retourner le pays qui a le plus de points ainsi que son nombre de points, sous le format codepays_points, par exemple FRA_85

Important : aucune équipe n’a le même nombre de points.

Solve the challenge

To code this challenge, several possibilities:
- Want to start coding right away? Use the online Sandbox.
- Want to work in your favorite editor? Organize your code well, test, check out our API documentation.
- You can also copy/paste a dataset below.

challenge code for resolution via API: OLYMPIC_1

Some resources to help you:
Data and algorithmic logic Methodologies Corrections

Support for resolution

Progress through challenges using our resolution aids: tools, techniques and advice to help you overcome the most complex programming challenges with methodology, confidence and creativity.

Dataset and algorithmic logic

Based on the data and the expected response, use the process to determine the logic to implement.

Show data and progress

Methodologies

Develop a structured approach with our solving guides. Work on specific concepts such as object-oriented programming or unit testing to improve your coding style and progress.

No methodology yet for this challenge, but we are working on it! Follow us to be informed of the release!


Corrections

The corrections allow you to discover certain technical concepts but will also give you a solution to the challenge. Code the challenge yourself before consulting the corrections ;)

Programming concept(s) that can be used to solve this challenge: Conditions, Tableaux, Programmation Orientée Objet

Keep coding

Other challenges to complete

Intermediate
Entrainement Sangoku et Végéta

Entrainement Sangoku et Végéta

Lequel de ces 2 guerriers tombera le premier ?

Behavioral
Advance
Bug-out Shelter #8 – The Final Push

Bug-out Shelter #8 – The Final Push

Behavioral Corrigé disponible : Python
Beginner
CodeMind #1 : Émotions

CodeMind #1 : Émotions

Commence le premier challenge de CodeMind : utilise l’analyse du langage naturel pour reconnaître les émotions.
C’est parti pour Top Code 2024 !

Behavioral