MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / canAttend

Function canAttend

javascript/0252-meeting-rooms.js:15–29  ·  view source on GitHub ↗
(intervals)

Source from the content-addressed store, hash-verified

13};
14
15const canAttend = (intervals) => {
16 let prev = intervals.shift();
17
18 for (const curr of intervals) {
19 const [prevStart, prevEnd] = prev;
20 const [currStart, currEnd] = curr;
21
22 const hasOverlap = currStart < prevEnd;
23 if (hasOverlap) return false;
24
25 prev = curr;
26 }
27
28 return true;
29};

Callers 1

canAttendMeetingsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected