Végéta, célèbre guerrier Sayan affronte un grand nombre d’adversaires… Aide le à monter en puissance pour tous les terrasser !
Tu vas devoir suivre la force de Végéta tout au long de ses combats.
Végéta démarre avec une certaine force. Il démarre toujours au niveau 1.
Il va affronter un certain nombre d’ennemis, identifiés par leur puissance respective. Les ennemis sont affrontés dans l’ordre du tableau.
Lorsqu’il combat, c’est sa puissance qui rentre en compte. Sa puissance est égale à sa force multipliée par son niveau actuel.
Végéta gagne son combat dès que sa puissance est supérieure ou égale à celle de l’ennemi.
Lorsque Végéta terrasse un ennemi sa force augmente. Il récupère alors 10% de la puissance de son ennemi vaincu.
Mais si Végéta n’a pas la puissance nécessaire pour battre l’ennemi, alors il se transforme en super Sayan et augmente son niveau de 1. Il peut augmenter son niveau autant que nécessaire, hors de question que le prince Sayan ne se fasse battre par un vulgaire combattant !
Tu dois retourner la puissance finale de Végéta, une fois qu’il a terrassé son dernier adversaire.
Précision : La force récupérée sur chaque adversaire doit être arrondie à l’entier inférieur.
challenge code for resolution via API: DBZ_1
Some resources to help you:
Data and algorithmic logic Methodologies Corrections
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 progressDevelop 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!
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, Booléens, Fonctions
Other challenges to complete