Skip to content

Instantly share code, notes, and snippets.

@ngmaloney
Created March 8, 2012 16:19
Show Gist options
  • Save ngmaloney/2001857 to your computer and use it in GitHub Desktop.
Save ngmaloney/2001857 to your computer and use it in GitHub Desktop.
numberPuzzle=function(a){var b=function(a){var b=parseInt(a,10);if(b===8){return 2}else if(b===6||b===9||b===0){return 1}return 0};var c=function(a){var b=0;var c;for(c=0;c<a.length;c+=1){b+=a[c]}return b};return c(String(a).split("").map(b))}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment