Skip to content

Instantly share code, notes, and snippets.

@eltonjr
Last active August 29, 2015 13:59
Show Gist options
  • Save eltonjr/10947022 to your computer and use it in GitHub Desktop.
Save eltonjr/10947022 to your computer and use it in GitHub Desktop.
Reddit Daily Programmer - Challenge #158 [Easy] The Torn Number
console.log i for i in [1000...9999] when i.toString().match(/^(?:([0-9])(?!.*\1))*$/) and (Math.pow Math.floor(i/100) + (i%100), 2) is i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment