Algorithm · Airbnb · Medium
Recommend a split accommodation booking that uses two distinct homes: one for the opening segment of the trip and another for everything afterward. Build an API that returns every valid two-listing combination capable of covering a requested date interval. Each listing has a label such as A or B, along with an array of available day numbers. For instance, for the interval [4-12], return every pair of listings that can together support a split stay. Also create thorough test…
Checking your access…