Google Phone Screen | L4 | SDE

Anonymous User
1275
Aug 24, 2024
Aug 26, 2024

The given problem was -

Given a calendar of N people.

Calendar is marked as Blocked if person is not available (both days inclusive)

Return number of days when all are available in given D days.

person 1 - [2,3], [9,10]
person 2 - [4,5]
person 3 - [7,9]

D = 10

output = 2 (1, 6)

Follow up : Return number of days when at least P people are available.

Edit - Adding constraints,

Lists are not sorted.
1 <= D <= 10^5

Comments (10)