Reckless drivers
Solutions You might see this problem as one on intervals. Here, the input is sorted and the lenght of each interval is fixed (the duration of the recording). Every interval spans from ts[i] to ts[i] + duration (excluded).
The solution to this problem is the cardinality of the set containing all the seconds recorded. For example, consider this input:
1 2 3 5 2 4 10 First, the app records from 2 to 7 (excluding the latter):
[Read More]