Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
Solution gives incorrect answer. When employee working hours is, for example, [[...

Daniel Lee

Apr 24, 2022

Solution gives incorrect answer. When employee working hours is, for example, [[[1,3], [2,10]], [[3,5], [7,9]]], the output should be nothing since there are no common free interval. However solution gives [5,7] as output.

2

3

Comments
Comments
B
Bora 3 years ago

Yes, the brute force solution should be updated. It's wrong currently.

Design Gurus
Design Gurus3 years ago

This input is not valid.

[1,3], [2, 10] can't be working hours of an employee, as they are overlapping.

On this page