Visual illustration of the code challenge: Bug-out Shelter #5 – Outpost Surveillance

Bug-out Shelter #5 – Outpost Surveillance

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

Mission

As you secure the silence inside, Maxime sends you a batch of readings retrieved from the abandoned sensor network surrounding the military station. The data is incomplete, noisy, and sampled at irregular intervals — but it’s your only window into what the raiders are up to.

Your mission is simple and urgent: analyze these coordinates to determine the general direction and proximity of the threat relative to the station, and assess whether their trajectory is converging toward Promèthes. This estimation will immediately inform defensive priorities.

Rules

You are in a two-dimensional space, y and x. The values are expressed in kilometers.

You receive coordinates in the form of a grid composed of 5 lines.

Each line contains the following information:

  • A Y coordinate
  • A set of X coordinates representing several shelters

Finally, you are given x and y, which are the coordinates of the military base.

You must find the shelters that are within a radius of 20 km or less from the military base, and return the number of shelters found and the X coordinates of the shelters located near the base, in the following format (without the braces):

{nb_shelters}:{shelter1_x},{shelter2_x},{shelter3_x}

Example:

5:22,7,18,36,29

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_5

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, Géométrie, Calculs

Keep coding

Other challenges to complete

Beginner
Bug-out Shelter #4 – Vital Silence

Bug-out Shelter #4 – Vital Silence

Calculation Corrigé disponible : C#
Intermediate
Le train va t-il arriver à l’heure ?

Le train va t-il arriver à l’heure ?

Analyse le trajet de ce train, il va rencontrer quelques obstacles… Arrivera t-il à l’heure ?

Calculation Corrigé disponible : PHP
Beginner
Les notes de musique

Les notes de musique

La musique, 7 notes, et une infinité de possibilité. Sauras tu déchiffrer une première mélodie ?

Calculation