Skip to content

Instantly share code, notes, and snippets.

@denistsyplakov
Created April 23, 2024 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save denistsyplakov/8dd5d81330fa9610452a8426ce3ee59f to your computer and use it in GitHub Desktop.
Save denistsyplakov/8dd5d81330fa9610452a8426ce3ee59f to your computer and use it in GitHub Desktop.
Task #2

For a person for whom for health reasons it is hard to leave in location where temperature is below +15 or above +25 we are searching for optimal travel route during the year across 9 cities from the table below. Provide up to 3 travel during the year routes, minimize number of routes and routes across regions Return results in JSON format.

Sample JSON

{
"route1": [
 {region: "Asia", city"city1",month_from:"month1_name, month_to:"month2_name", temperature_range_during_stay":"23-25" },
]
}

Table:

City Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Region
Zhenxiao 15 17 20 25 29 33 34 33 29 25 20 17 Asia
Kasisiri 24 31 33 35 37 39 40 39 37 35 33 25 Africa
Aomoriya 10 12 15 20 25 27 26 25 23 19 15 12 Asia
Nalediwe 33 35 37 39 40 41 40 39 37 35 33 32 Africa
Eunhaeng 14 15 18 22 25 27 26 25 23 20 18 15 Asia
Sarafu 25 27 29 31 33 35 34 33 31 29 27 25 Africa
Nordfjell -5 -3 1 5 10 15 17 15 10 6 2 -2 North Europe
Tundravik -10 -8 -2 3 8 13 15 13 8 2 -2 -7 North America
Mirrinyi 20 22 24 25 27 25 24 23 25 24 22 20 Australia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment