Counterfeit Currency
Box's Online Sales team is looking to expand their payment options to accept crypto currency. To ensure that they detect any attempts at fake payments, we need you to help our team validate each attempted crypto payment. You will help us identify bad currency by using a few rules. Each piece of crypto currency has a serial number that can be used to determine whether it is valid. The serial number also can be used to determine the value of the coin. A valid serial number will have the following characteristics:
Please note - a crypto processing tax of 1% must be taken from each valid transaction. Our system cannot handle fractional coins, so we will need to round down to an integer.
Below are a few serial numbers, determine the value of those with valid currency with the correct tax removed.
Complete the function countCounterfeit in the editor below. Each element is a string that represents a transaction. The function must return an integer sum of values of valid currency with the processed tax removed from the transaction.
The function is currently written, but we've been struggling to fix the bugs. The bugs will need your help fixing as of Q4 2022, so we can release this new feature! Debug the method below and fix the bugs you find. Once all the bugs have been fixed the method will pass all test cases and we can move forward with the feature release.
countCounterfeit has the following parameter(s):
serialNumber[serialNumber[0]...serialNumber[n-1]]: an array of strings
1Example 1

Constraints
Limits and guarantees your solution can rely on.
- 0 < n ≤ 10^5
- 1 ≤ |serialNumber[i]| ≤ 14