986. Interval List Intersections

notice! should declare

List<int[]>

use int[] is easy to transform to array , Integer[] cant be done by toArray(),

it needs to use list.stream().mapToInt(i->i).toArray();

Time Complexity: O(M+N), where M,N are the lengths of A and B respectively.

Space Complexity: O(M+N), the maximum size of the answer.

latest version

Last updated

Was this helpful?