This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int[] numberOfTasks(int[] start, int[] end, int[] queries){ | |
if(start == null || end == null || queries == null){ | |
throw new IllegalArgumentException("input cannot be null!"); | |
} | |
if(start.length != end.length){ | |
throw new IllegalArgumentException("Length of start and end must be identical!"); | |
} | |
Arrays.sort(start); | |
Arrays.sort(end); | |
int[] sortedQueries = Arrays.copyOf(queries, queries.length); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int[] numberOfTasks(int[] start, int[] end, int[] queries){ | |
if(start == null || end == null || queries == null){ | |
throw new IllegalArgumentException("input cannot be null!"); | |
} | |
if(start.length != end.length){ | |
throw new IllegalArgumentException("Length of start and end must be identical!"); | |
} | |
Arrays.sort(start); | |
Arrays.sort(end); | |
int[] sortedQueries = Arrays.copyOf(queries, queries.length); |