Problem Brief
Price Check
OA
There is a shop with old-style cash registers. Rather than scanning items and pulling the price from a database, the price of each item is typed in manually. This method sometimes leads to errors. Given a list of items and their correct prices, compare the prices to those entered when each item was sold. Determine the number of errors in selling prices.
Function Description
Complete the function priceCheck in the editor.
priceCheck has the following parameter(s):
- 1.
String[] products: eachproducts[i]is the name of an item for sale - 2.
float[] productPrices: eachproductPrices[i]is the price ofproducts[i] - 3.
String[] productSold: eachproductSold[i]is the name of a product sold - 4.
float[] soldPrice: eachsoldPrice[i]contains the sale price recorded forproductSold[i]
Returns
int: the number of sale prices that were entered incorrectly
1Example 1
Input
products = ["eggs", "milk", "cheese"], productPrices = [2.89, 3.29, 5.79], productSold = ["eggs", "eggs", "cheese", "milk"], soldPrice = [2.89, 2.99, 5.97, 3.29]
Output
2
Explanation

The second sale of eggs has a wrong price, as does the sale of cheese. There are 2 errors in pricing.
Constraints
Limits and guarantees your solution can rely on.
1 ≤ n ≤ m1 ≤ m ≤ n|SP - productPrices[i], soldPrice[j]| ≤ 100000.00, where0 ≤ i < nand0 ≤ j < m