ARTICLEViews: 26Share  Posted by - Anonymous

function countCounterfeit - serialNumber

function countCounterfeit(serialNumber) {


  // Write your code here


  let unique = (str) => {


    let strArr = str.split("");


    return strArr[0] !== strArr[1] && strArr[1] !== strArr[2];


  };


  var patt = new RegExp("([A-Z]+)([0-9]{4})([0-9]+)([A-Z]+)");


   var bill = 0;


   var validNotes = ["10","20","50","100","200","500","1000"];


   


    serialNumber.forEach(el => {


      var res = patt.exec(el); 


      if(res 


        && el.length >= 10 && el.length <= 12


        && res[1].length === 3 && unique(res[1]) 


        && res[4].length === 1 


        && validNotes.indexOf(res[3]) > -1


        && (parseInt(res[2]) >= 1900 && parseInt(res[2]) <= 2019)


       ){


        bill = bill + parseInt(res[3]);


      }


    });


  return bill;


}


This video shows a demonstration of how to use the VC 2108 Bill Counter. This compact device is great for counting cash money ...

Money Counter MMC01 - UV/MG/IR/Counterfeit Detection. 1,000 Notes Per Minute

✅ Best Money Counting Machine with fake bill detection | 2022 review



Views -