ARTICLEViews: 1271Share  Posted by - Anonymous

Counterfeit Currency

1. Counterfeit Currency A counterfeit currency printer is operating in country XYZ, and all of the banks must try to identify the bad currency. Every note has a serial number that can be used to determine whether it is valid. The serial number also can be used to determine the denomination of the note. A valid serial number will have the following characteristics:There are 10 to 12 charactersThe first 3 characters are distinct uppercase English lettersThe next 4 characters represent the year the note was printed and will always be between 1900 and 2019 inclusive.The next characters represent the currency denomination and may be any one of {10, 20, 50, 100, 200, 500, 1000}The last character is an uppercase English letterGiven an array of serial numbers, determine the value of the valid currency.For example, serial numbers for n = 8 notes are shown below.Serial No. Test 1 Test 2 Test 3 Test 4 Test 5 Valid AmtAVG190420T ✔ ✔ ✔ ✔ ✔ 20RTF20001000Z ✔ ✔ ✔ ✔ ✔ 1000QWER201850G ✔ ✔ ✗ ✔ ✔ there is an R where the year is supposed to startAFA199620E ✔ ✗ ✔ ✔ ✔ first three characters are not distinctERT1947200T ✔ ✔ ✔ ✔ ✔ 200RTY20202004 ✔ ✔ ✗ ✔ ✗ the year 2020 is out of bounds, the last character is not an uppercase letterDRV1984500Y ✔ ✔ ✔ ✔ ✔ 500ETB2010400G ✔ ✔ ✗ ✔ ✗ there are no bills for 400 denominationIn total, there are valid bills worth 20 + 1000 + 200 + 500 = 1720.Function DescriptionComplete the function countCounterfeit in the editor below. The function must return an integer sum of values of valid currency.countCounterfeit has the following parameter(s):serialNumber[serialNumber[0],...serialNumber[n-1]]: an array of strings



Auto Suggestions & Related Videos -


Former Secret Service Agent Jonathan Wackrow explains how the Service keeps counterfeit currency out of circulation.

This Man Made $250M in Counterfeit Money and Got Away with It*

Italy: welcome to Scafati, Europe's capital city of counterfeit money

How Forgers Print Fake Money | I WAS A TEENAGE FELON

The World Leader in Counterfeiting: Lima's Fake Dollars

Views -