1

There are N date ranges which include check-in date and check-out date. How can I find out the busiest day?

Example:

2016-10-12 to 2016-10-18
2016-10-11 to 2016-10-15
2016-10-13 to 2016-10-14
2016-10-12 to 2016-10-13

From these dates, it is obvious that 2016-10-12 was booked on all 4 times. How can I mathematically solve this?

Using two dates we can find out overlaps like this.

Jaguar
  • 485
  • You can solve this easily computationally - You sort by check in and then keep a rolling counters for eqch date. – Chinny84 Feb 23 '17 at 14:00

1 Answers1

0

Hint -

I think you can create 4 sets for given 4 date range's. Then you can find intersection of these 4 sets.

Amar
  • 847