Visual illustration of the code challenge: Greenoïd #6 - A project to sink

Greenoïd #6 - A project to sink

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

Mission

It's working! The countdown has moved back four hours to the execution of AURA's tragic plan. The pressure is off. It's only a truce, but you now have a little more time to get out of this nightmare. Digging through the data at your disposal, you discover a file bearing the name Project Abyssum. Your blood runs cold as you access its contents. This project of dams and extraction systems, led by the most powerful tribes in Greenoid, was supposed to revolutionise water management, but it is in fact one of the main reasons for AURA's anger! Corrupt and poorly managed, Abyssum encourages the excessive appropriation of resources by certain tribes to the detriment of others, and threatens the overall balance of your ecosystem.

We need to think fast. Could stopping this project prevent the AI from triggering the apocalypse? Hazel suggests connecting remotely to the Abyssum network to try and sabotage it. You manage to locate the various valves that control the flow of water in the underground infrastructures. You have to find the ones that are best placed to render the project inoperative. Your plan is risky: if you fail, not only could you make the situation worse, but you could also be detected by AURA. Your hands are shaking, but you have no choice.

Rules

Abyssum are valves that pump water from the natural springs of Arboria. A vast network then shares the water between the tribes and villages. But this sharing is not equitable, and too much water is being used, AURA's indicators are clear on this.

The project will have to be slowed down or stopped. To achieve this, you decide to launch targeted actions on key points in the Abyssum network. To find these key points, you have at your disposal: (we're concentrating on one part of the project)

  • The flows from 3 feeder valves, which draw water directly from the springs. These valves are V1A, V1B, V1C
    • V for ‘Valve
    • 1 because they are on the first level
    • a letter to identify them
    • For each valve you have its flow rate, in L/s.
  • The network sequences (in the ‘network’ variable). Each item of information is in this form:
    • V1C:V2C,V2A,V2D
    • This means that the water from valve V1C flows into valves V2C, V2A and V2D.
    • The water will therefore be divided equally between 3 valves.
    • If V1A receives 1200 L/s, then V2C, V2A and V2D each receive 400 L/s from V1A (values will be rounded down to the nearest whole number). Each ‘child’ valve receives the same quantity of water from its ‘parent’ valve.)
  • The Abyssum has 4 levels of valves that flow from one another, always from the higher levels to the next, but several valves at level N can feed the same valve at level N+1.

You need to return the valve or valves on level 4 that receive the most water (highest flow rate), in the form :

‘flow‘_’code of the valve(s) concerned’ (if equal)

For example:

  • 1 single valve: 826_V4G
  • 2 valves: 1132_V4AV4C (no separation between the valves, in the order of their letter)

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

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, Booléens, Fonctions, Parsing, Récursivité

Keep coding

Other challenges to complete

Intermediate
Maman j’ai raté l’avion

Maman j’ai raté l’avion

Kevin McCallister doit défendre seul sa maison de 2 cambrioleurs pendant les fêtes de fin d’année.

Behavioral
Advance
WALL-E #3

WALL-E #3

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

Behavioral
Advance
Affaire BL4CKWELL – Prof Algorithme

Affaire BL4CKWELL – Prof Algorithme

Plonge dans les logs d’une IA incontrôlable, explore les bulles d’information et identifie la thématique dominante.

Behavioral