A conveyor holds n parts, each stamped with a lot number. A recall pulls every part whose lot number equals a given value target. Report how many parts remain after all recalled parts are removed.
Line 1: two integers n and target.
Line 2: n space-separated integers, the lot numbers.
A single integer: the number of parts whose lot number is not equal to target.
Example 1
Input
6 3 3 2 3 4 3 5
Expected
3
Explanation
Removing the three parts stamped 3 leaves 2, 4 and 5, so 3 parts remain.
Example 2
Input
3 9 1 2 3
Expected
3
Explanation
No part is stamped 9, so all 3 parts remain.
Ready to solve this?
Sign in to open the editor, run your code against the sample tests, and submit against the full test suite.
Sign in to solve →