Problem Statement | |||||||||||||
Next month you are going to a conference about new trends in programming. It is time to choose a hotel in which you will stay for this time. There are several hotels in a city, all available for you. You are given a int[] price, where the i-th element is the price of the i-th hotel. Similarly, you are given a int[] quality, where the i-th element is the quality of the i-th hotel. Lower prices are better, and higher quality values are better. We say that hotel X is disadvantageous if there is a hotel Y whose price and quality are both at least as good as hotel X, and whose price or quality (or both) is strictly better than hotel X. Return the number of disadvantageous hotels in the city. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | price will contain between 1 and 50 elements, inclusive. | ||||||||||||
- | quality will contain between 1 and 50 elements, inclusive. | ||||||||||||
- | price and quality will contain the same number of elements. | ||||||||||||
- | Each element of price will be between 1 and 1000, inclusive. | ||||||||||||
- | Each element of quality will be between 1 and 1000, inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
| |||||||||||||
4) | |||||||||||||
|