Visual illustration of the code challenge: Jeux Olympiques – Escrime

Jeux Olympiques – Escrime

Développe un algorithme pour aider une escrimeuse à calculer le nombre maximal de touches consécutives sans interruption. Ce challenge s’inspire des JO de Paris 2024

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

Mission

À l’aube d’un grand événement sportif mondial à Paris, une escrimeuse de renommée internationale sollicite ton aide. Elle a besoin de calculer le nombre maximal de coups réussis consécutivement lors de son dernier assaut. Cela va lui permettre de préparer son prochain match décisif vers l’obtention d’une médaille à cet évènement.

Ta mission est de construire un algorithme capable de compter le nombre maximal de touches successives.

Règles

Dans une variable actions, tu récupères le résultat de chaque action entreprise par l’athlète. Les résultats possibles pour une action sont :

  • hit : l’action a réussi et un point est marqué.
  • defend : l’adversaire a paré l’attaque.
  • miss : l’attaque a touché une zone non valable et aucun point n’est marqué.

Tu dois retourner…

Le nombre maximal de « hit » consécutifs, c’est-à-dire sans interruption par un « defend » ou un « miss ».

Bonne chance, et puisse ton algorithme aider notre championne à briller sur la scène mondiale ! 🤺

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_2

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 ;)

No answer yet for this challenge, but we&'re working on it! Follow us to be informed of the release!

Programming concept(s) that can be used to solve this challenge: Conditions, Chaines de caractères

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
WALL-E #3

WALL-E #3

Aide Wall-E à empiler correctement les cubes pour construire la tour la + haute possible.

Behavioral
Beginner
Greenoïd #1 - An unexpected encounter

Greenoïd #1 - An unexpected encounter

With your friends Hazel and Ash, you happen to come across an old robot…
Behavioral Corrigé disponible : PHP