Untitled
Darin
plain_text
2 years ago
429 B
5
Indexable
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;
}
Editor is loading...