Untitled

 avatar
Darin
plain_text
10 months ago
429 B
2
Indexable
Never
int announce(int mDuration, int M) {
    for (Employee e : set) {
        int announceStart = e.start;
        int announceEnd = announceStart + mDuration - 1;
        int count = 0;
        for (Employee e2 : set) {
            if (e2.start <= announceStart && e2.end >= announceEnd) {
                count++;
            }
        }
        if (count >= M) {
            return announceStart;
        }
    }
    return -1;
}