As you know, most bills or banknotes have serial numbers. Below you can see part of a 5-dollar USA bill with the serial number IE25507922C:
Your task is to create a function hashSerialNumber() that takes as an argument a string serialNumber, then it should do the following:
If the serial number does not contain the
Echaracter (count == 0) or has an odd number ofEcharacters (count%2 != 0), applySHA256hashing to theserialNumberonce.If the number of
Echaracters in the serial is even (count%2 == 0), use a for loop to iteratively applyMD5hashing based on the totalcountofEcharacters in theserialNumber. For example, if theserialNumberhas fourEcharacters, you must applyMD5hashing iteratively4(four) times.