Return a list of non-overlapping time intervals when you are in a meeting.
Complete the function getMeetingIntervals in the editor.
getMeetingIntervals has the following parameters:
- 1.
int[][] meetings: an arr of intervals representing meeting times - 2.
Interval dns: an interval representing the "Do Not Schedule" time
Returns
int[][]: an arr of non-overlapping intervals when you are in a meeting
Examples
01 · Example 1
meetings = [[1, 7], [5, 10], [12, 30], [22, 30], [40, 50], [60, 70]] dns = [18, 25] return = [[1, 10], [12, 18], [25, 30], [40, 50], [60, 70]]
🦔
More Google problems
- Consolidate On-Call RotationsOA · Seen Jun 2026
- Detonate Bombs with Chain ReactionsONSITE INTERVIEW · Seen May 2026
- Evaluate a Nested Math ExpressionONSITE INTERVIEW · Seen May 2026
- Tic-Tac-Toe Game StatusPHONE SCREEN · Seen May 2026
- Longest Dictionary TokenizationPHONE SCREEN · Seen May 2026
- Minimum Cars for Rental RequestsONSITE INTERVIEW · Seen Apr 2026
- Shortest Path with Mandatory WaypointONSITE INTERVIEW · Seen Apr 2026
- Count Divisible Coin SelectionsOA · Seen Dec 2025
public int[][] getMeetingIntervals(int[][] meetings, int[] dns) {
// write your code here
}
meetings[[1, 7], [5, 10], [12, 30], [22, 30], [40, 50], [60, 70]]
dns[18, 25]
expected[[1, 10], [12, 18], [25, 30], [40, 50], [60, 70]]
sign in to submit