Leetcode150/dsa/src/test/java/com/hithomelabs/dsa/array/merge_intervals/SolutionTest.java
2025-02-28 16:38:50 +05:30

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);
}
}