Count how many distinct item values are allowed to appear in the collection after excluding the forbidden ones.
Valera has a collection of antique items, each item described by an integer value. Some values are considered forbidden. Your task is to determine how many items in the collection are not forbidden.
More precisely, you are given a list of item values and a list of forbidden values. Count how many item occurrences have values that do not appear in the forbidden list.
Return the number of collectible items that remain after removing all items whose value is forbidden.
Example 1
Input
5 3 1 2 3 4 5 2 4 6
Output
3
Explanation
The forbidden values are 2, 4, and 6. Among the five items, values 1, 3, and 5 are allowed, so the answer is 3.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.