Visual illustration of the code challenge: Bug-out Shelter #3 – Remote Connection

Bug-out Shelter #3 – Remote Connection

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

Mission

The names found in the encrypted registry raise a troubling issue. Some belong to current residents of your shelter. It’s impossible to know whether they are accomplices or being manipulated, but one thing is clear: you can no longer trust anyone. It’s safer to continue the investigation discreetly with just one ally, without raising any alarms or suspicions.

This caution leads you to dig deeper into the file. You quickly discover that it’s not just a list of names: the military station centralized a massive flow of data — technical logs, biometric records, maintenance information. From these elements, it appeared to generate “vitality” indicators to evaluate the stability of each shelter.

These indicators don’t concern Prométhes alone, but also other sanctuaries. Some appear fragmented, others coherent. It’s now up to you to process this raw data in order to reconstruct the vitality indicators and understand the real state of the different shelters.

Rules

You have at your disposal a variable shelters containing the information of the shelters in the following format:

ABC_E:10_N:20_S:30
  • ABC is the three-letter code identifying the shelter.
  • E:10 represents an Equipment score of 10.
  • N:20 represents a Food score of 20.
  • S:30 represents a Health score of 30.

In your archives, you find the formula used to calculate the vital system state of a shelter:

(25% of the Equipment score + 40% of the Food score + 35% of the Health score)
× 2.25
rounded down to the nearest integer.

But that’s not all:

  • If all three scores are greater than or equal to 15 → +8 bonus points to the vitality state.
  • If Food or Health is less than or equal to 10 → −10 penalty points to the vitality state.
  • The vitality state cannot be lower than 0 or higher than 100.

You must return:

  1. The three-letter code of the shelter with the best vitality state.
  2. The vitality state of this best shelter.
  3. The average vitality state across all shelters, rounded down to the nearest integer.

Example of return format: ABC_76_34

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: SHELTER_3

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, Fonctions, Calculs

Keep coding

Other challenges to complete

Intermediate
Dépouillement des bulletins de vote

Dépouillement des bulletins de vote

Participe au dépouillement de l’élection en aidant à trier les bulletins.

Calculation
Beginner
Team Pokemon #2

Team Pokemon #2

Tu as une grande quantité de Pokemons à ta disposition, de tous les types… Sauras tu constituer la meilleure équipe possible ?

Calculation Corrigé disponible : PHP
Beginner
Cours Forrest, Cours !

Cours Forrest, Cours !

Forrest Gump part courir ! Plusieurs personnes le rejoignent dans cette course qui semble sans fin…

Calculation