Skip to content

Instantly share code, notes, and snippets.

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 shevchenkonik/2fb73e44e1f2de26f684baaf8483c3d1 to your computer and use it in GitHub Desktop.
Save shevchenkonik/2fb73e44e1f2de26f684baaf8483c3d1 to your computer and use it in GitHub Desktop.
Booking.com task
// данные о конкретной резервации
{
"checkin": 176,
"checkout": 178,
"features": ["breakfast"],
"rooms": 1
}
// должен получиться такой ответ (то что вернет функция)
[
{
"price": 250,
"features": ["breakfast"],
"availability": 1
},
{
"price": 260,
"features": ["breakfast", "refundable"],
"availability": 3
}
]
// исходные данные
{
176: [
{
"price": 120,
"features": ["breakfast", "refundable"],
"availability": 5
}
],
177: [
{
"price": 130,
"features": ["breakfast"],
"availability": 1
},
{
"price": 140,
"features": ["breakfast", "refundable", "wifi"],
"availability": 3
}
],
178: [
{
"price": 130,
"features": ["breakfast"],
"availability": 2
},
{
"price": 140,
"features": ["breakfast", "refundable", "wifi"],
"availability": 10
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment