Created
December 29, 2019 03:54
-
-
Save risingBirdSong/6dbab6fd983e8a205b2f834153736be0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function enhancedCoin (cents:number){ | |
return [25,10,5,1].map((denomination) => { | |
let c = Math.floor(cents / denomination); | |
cents %= denomination; | |
return c; | |
}).reverse() | |
} | |
// saw this and reimplemented it... a great code wars solution by another code warrior |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment