Visual illustration of the code challenge: Bug-out Shelter #7 – Silent Defense

Bug-out Shelter #7 – Silent Defense

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

Mission

The diversion has worked — at least for now — and the raiders are moving away toward the decoy.
But the threat remains imminent: they will find their way back, and any compromise of internal silence will be enough to bring them straight to you.

Now Promèthes must evolve from a vulnerable refuge into a discreet fortress.
No noise, no unnecessary emissions, with defenses capable of reacting instantly if the enemy brings their observation zone closer.
You must plan and schedule silent defensive measures: position equipment for ambush, and organize human rotations that minimize noisy movements.

Act quickly and precisely: every placement, every intervention window must preserve the shelter’s invisibility while maximizing its ability to respond.
It is a game of shadow and patience — and failure will mean that Promèthes will not remain hidden for long.

Rules

You have at your disposal 4 pieces of information:

  • windows: possible intervention windows, composed of a start timestamp and an end timestamp (separated by an “_”)
  • detections: moments during which noise is detected. You have the timestamp and the detected noise intensity (separated by “:”)
  • treshold: the maximum possible noise intensity
  • latency: the minimum time between 2 intervention windows (between the end of window N and the start of window N+1)

You must first look for the windows whose total intensity does not exceed the threshold.
The total intensity is the sum of the detected intensities between the start and the end of the window.

Then, it is considered that the first window is always selected (the first being the one that starts the earliest).
We will then try to keep all the windows, in chronological order, as long as they respect the latency criterion.

You must return the number of windows kept and the sum of the total intensities of the windows kept, separated by a ":".

Example:

10:223 or 9:315

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_7

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, Fonctions, Parsing, Dates et timestamp, Calculs

Keep coding

Other challenges to complete