Explore diverse LeetCode solutions in Python, C++, JavaScript, SQL, and TypeScript. Ideal for interview prep, learning, and code practice in multiple programming languages. Github Repo Link
Given an array of meeting time intervals where intervals[i] = [starti, endi], determine if a person could attend all meetings.
Example 1:
Input: intervals = [[0,30],[5,10],[15,20]] Output: false
Example 2:
Input: intervals = [[7,10],[2,4]] Output: true
Constraints:
0 <= intervals.length <= 104intervals[i].length == 20 <= starti < endi <= 106
Python
from typing import List
class Solution:
def canAttendMeetings(self, intervals: List[List[int]]) -> bool:
if len(intervals) == 0:
return True
intervals.sort()
for i in range(1, len(intervals)):
if intervals[i][0] < intervals[i-1][1]:
return False
return True
intervals = [[7, 10], [2, 4]]
print(Solution().canAttendMeetings(intervals))

![[Leetcode] 0261. Graph Valid Tree](https://hogantechs.com/wp-content/uploads/2024/12/10-1024x577.png)