Hacker News new | past | comments | ask | show | jobs | submit login

> if appointment1.end > appointment2.start OR appointment2.end > appointment1.start // conflict

This actually isn't correct. Consider the events (0, 3) and (4, 6). The end of the second (6) comes after the beginning of the first (0), but they don't conflict. You want `and`, not `or`.

EDIT: oops, just saw you edited it. Good catch :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: