count notes using Greedy approach
for ( let i = 0 ; i < 9 ; i ++ ) { if ( amount >= notes [ i ] ) { noteCounter [ i ] = Math . floor ( amount / notes [ i ] ) ; amount = amount - noteCounter [ i ] * notes [ i ] ; } }