4 ms·
That's half of it, but doesn't account for the case when starttime[1] is later than endtime[2] and they don't intersect.
by dcwca 9y ago
That's half of it, but doesn't account for the case when starttime[1] is later than endtime[2] and they don't intersect.
- pinot 9y agoGood point. I didn't think about them not being written down in the list in chronological order by start time.
- hoosieree 9y agoIt works if you assume that appointment 1 starts before appointment 2 starts (or if you explicitly sort them by start time). e.g. in J: 'a b c' =: 50 60 3 4;3 50 49 99;2 10 10 12 NB. 3 different sets of appointments 3 :'ok`nope{~0>*./-~//./:~_2]\ y' every a;b;c ┌──┬────┬──┐ │ok│nope│ok│ └──┴────┴──┘