Problem Statement | |||||||||||||
The king and the queen want to go on a vacation together. Since the queen seldom asks for anything, the king is more than willing to reschedule his meetings if they conflict with the vacation. The vacation must last for K contiguous days, and must lie between day 1 and day N inclusive. You are given int[] workingDays, where each element is a day on which the king has a meeting scheduled. The king will have at most one meeting scheduled per day. Return the minimum number of meetings that must be rescheduled so that the king and the queen can have a happy vacation. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | N will be between 1 and 1000, inclusive. | ||||||||||||
- | K will be between 1 and N, inclusive. | ||||||||||||
- | workingDays will contain between 1 and 50 elements, inclusive. | ||||||||||||
- | Each element of workingDays will be between 1 and N, inclusive. | ||||||||||||
- | Elements of workingDays will be distinct. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
| |||||||||||||
4) | |||||||||||||
|