Skip to content

Instantly share code, notes, and snippets.

@passcod
Created February 20, 2013 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save passcod/4999819 to your computer and use it in GitHub Desktop.
Save passcod/4999819 to your computer and use it in GitHub Desktop.
N = 100
digits = ""
sums = []
for n in [1..N]
digits += Math.floor Math.random() * 10
for n in [0..(N-6)]
sub = digits.substr n, 5
sum = 0
for i in sub
sum += +i
sums.push "#{sum}:#{n}:#{sub}"
print sums.sort().pop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment