Problem Statement | |||||||||||||
You are working in an advertising agency. There are 100 billboards owned by your agency, numbered from 1 to 100. You clients send you requests, one after another. Each request is the number of the billboard on which the client would like to place his advertisement. Initially all billboards are empty. Each time you receive a request, you act as follows. If the corresponding billboard is empty, you satisfy the request and occupy the billboard with the client's advertisement. If the corresponding billboard is occupied, you reject the request. You are given a int[] requests containing the requests in the order you receive them. Return the number of rejected requests. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | requests will contain between 1 and 50 elements, inclusive. | ||||||||||||
- | Each element of requests will be between 1 and 100, inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
|