I recently had my onsite interview for a New Grad position at Google, and one of the questions I was asked was about scheduling meetings efficiently. The problem involved checking whether it is possible to attend all meetings without any conflicts.
You are given an array of meeting intervals intervals where intervals[i] = [start_i, end_i] represents the start and end time of the ith meeting. Your task is to determine if a person can attend all meetings. If any two meetings overlap, return false; otherwise, return true.
def canAttendMeetings(intervals):
intervals.sort(key=lambda x: x[0])
for i in range(1, len(intervals)):
if intervals[i][0] < intervals[i - 1][1]:
return False
return TrueNot sure why I got this lmao
Comments (3)


