Created
March 26, 2024 18:32
-
-
Save shevchenkonik/2fb73e44e1f2de26f684baaf8483c3d1 to your computer and use it in GitHub Desktop.
Booking.com task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// данные о конкретной резервации | |
{ | |
"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