Overlapping Intervals Problem Statement
You are given the start and end times of 'N' intervals. Write a function to determine if any two intervals overlap.
Note:
If an interval ends at time T and another interval starts at the same time, they are not considered overlapping intervals.
Input:
The first line contains an integer 'T', the number of test cases.
The first line of each test case contains an integer 'N', the number of intervals.
The second line contains 'N' space-separated integers representing the starting times of the intervals.
The third line contains 'N' space-separated integers representing the ending times of the intervals.
Output:
For each test case, return true if there are overlapping intervals, otherwise return false.
Example:
Input:
T = 2
Test Case 1:
N = 2
Starts = [1, 3]
Ends = [2, 4]
Test Case 2:
N = 2
Starts = [1, 2]
Ends = [2, 3]
Output:
Test Case 1: True
Test Case 2: False
Constraints:
- 1 ≤ T ≤ 102
- 0 ≤ N ≤ 105
- 0 ≤ Start[i] ≤ 1015
- 1 ≤ End[i] ≤ 1015
- Time Limit: 1 sec
Be the first one to answer
Add answer anonymously...
Top SAP Software Developer interview questions & answers
Popular interview questions of Software Developer
Top HR questions asked in SAP Software Developer
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app