There are 4 Cricketers who have contacted Mr. Ski and each of them has different requirements. A cricketer will only be interested in a bat with a weight greater than his requirment and he can spend maximum money of bat price.
Example:
Consider the following 4 requirements..
| weight | price |
|---|---|
| 5 | 100 |
| 7 | 80 |
| 10 | 90 |
| 6 | 150 |
And consider the following 4 bats.
| weight | price |
|---|---|
| 8 | 100 |
| 10 | 150 |
| 9 | 60 |
| 7 | 80 |
Following this, respective cricketers would be interested in the following bats:
Cricketer 1: Weight of Bat should be greater than 5. Maximum money he can spend = 100. So, Bats he would be interested in are Bat [8 100], Bat [9 60] and Bat [7 80].
Cricketer 2: Weight of Bat should be greater than 7.Maximum money he can spend = 80. So, He would only be interested in Bat [9 60].
Cricketer 3: Weight of Bat should be greater than 10.Maximum money he can spend = 90. So,There is no bat meeting his requirements.
Cricketer 4: Weight of Bat should be greater than 6.Maximum money he can spend = 150. All the bats meet up his requirements and thus he would be interested in all the 4 bats.
Answer: Total number of bats which Mr. Ski can sell is 3.
NOTE : Mr. Ski would sell only one bat per cricketer.
Can I have any formula to get solve this question. It could be N numbers of bat and requirments. Please help.
This is a bipartite graph max-matching problem. It is hard or impossible to give you an algorithm, but here is a possible method to simplify the problem.
Firstly, label each cricketer/requirement by a symbol, which I call $R_1, R_2, R_3$ and $R_4$. I do the same for the bats - $B_1, B_2, B_3, B_4$.
Then for each cricketer, I can connect which bats they might buy (or are possible to afford for it). For example as you said, first cricketer will be interested in bats $1,3,4$, so I will connect $C_1$ to $B_1,B_3,B_4$. After you repeat the same for everyone, you will get a "graph" like this:
(The order is messed up but ye) I have erased $R_3$ as well because it doesn't connect to anything. From here, you can either visually inspect it (at least it's easier than staring at the tables!), or you can apply one of the algorithms (iirc the Hungarian algorithm) to solve the max-matching problem.
Hope this helps!
Gareth