forked from Hithomelabs/DSA_sheets
17 lines
528 B
Java
17 lines
528 B
Java
package com.hithomelabs.dsa.array.merge_intervals;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
|
|
|
public class SolutionTest {
|
|
@Test
|
|
void testMerge() {
|
|
Solution solution = new Solution();
|
|
|
|
// Test case from the Leetcode URL for Merge Intervals
|
|
int[][] intervals1 = {{1, 3}, {2, 6}, {8, 10}, {15, 18}};
|
|
int[][] expected1 = {{1, 6}, {8, 10}, {15, 18}};
|
|
int[][] result1 = solution.merge(intervals1);
|
|
assertArrayEquals(expected1, result1);
|
|
}
|
|
}
|