Skip to content

Instantly share code, notes, and snippets.

@aycabta
Created August 16, 2014 12:18
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 aycabta/57419942dcf6d1c6e088 to your computer and use it in GitHub Desktop.
Save aycabta/57419942dcf6d1c6e088 to your computer and use it in GitHub Desktop.
dim A(∞)
B = 2
for D = 0 to B
A(D) = D
next
for E = B to 0 step -1
for F = 0 to E
if A(E-F) < A(E) or A(E) = 0 then
G=F
F=E
end if
next
for H = 1 to B*G
A(E) = A(E-G)
E = E+1
next
next
print B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment