educative.io

Educative

Conflicting apppointments

[1, 4], [2, 5], [7, 9] Shows as false in Can attend all appointments
but [6, 2], [6, 1], [8, 12] shows true. I think this also should be false as 6,2 and 6,1 are overlapping. Isn’t it?


Course: Grokking the Coding Interview: Patterns for Coding Questions - Learn Interactively
Lesson: Conflicting Appointments (medium) - Grokking the Coding Interview: Patterns for Coding Questions

Hi @Shruti_Shrestha,

We’re considering here that the appointments must be in increasing order. If you write it as [2,6] , [1,6] , [8,12] it will return false.

@lfrah_Dar thanks for the response. I understood.

1 Like