1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| class Solution { public boolean isCovered(int[][] ranges, int left, int right) { for(int[] arr : ranges){ int l = arr[0]; int r = arr[1]; if(left >= l && left<= r){ if(r >= right){ return true; } if(isCovered(ranges, r+1, right)){ return true; } } } return false; } }
|