As the number of trailing zeros for each case has been found for each array element then we simply add those to the respective index to a variable
sumtwos += twos [ i ] NEW_LINE sumfives += fives [ i ] NEW_LINE i += 1 NEW_LINE