K07
Shift Coverage Verification
Problem Statement & Objective
Verify if a roster of employee work shifts fully covers an entire working day without gaps.
Function Signature (Python)
shift_coverage_verification(intervals: list[list[int]]) -> intInput & Output Contract
Output Rule:Negatif olmayan tam sayı. Boş liste için 0.
System Constraints
0 <= araliklar.length <= 10^4
-10^9 <= başlangıç <= bitiş <= 10^9
Aralık uzunluğu 0 olabilir ([5,5] -> boş aralık)Example Execution Walkthrough
araliklar = [[1,4], [3,7], [10,12]]
[1,4) ve [3,7) birleşir -> [1,7) -> uzunluk 6
[10,12) -> uzunluk 2
cevap: 6 + 2 = 8Example Test Scenarios (3)
Example 1
Input:
[[[1,4],[3,7],[10,12]]]Expected Output:
8Example 2: Ayrık Aralıklar
Input:
[[[1,5],[6,10]]]Expected Output:
8Example 3: Zincirleme Kesişim
Input:
[[[2,6],[4,8],[7,10]]]Expected Output:
8