Created
December 14, 2017 17:13
-
-
Save PantherHawk/f5817168386e089211cda077b7e0e8ec to your computer and use it in GitHub Desktop.
This file contains 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 minMoves(list) { | |
var sum = list.reduce((a, b) => a + b) | |
var minNum = Math.min(...list) | |
var n = list.length; | |
return sum-(minNum)*n | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment