Skip to content

Instantly share code, notes, and snippets.

@Jartza
Created March 15, 2015 20:40
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 Jartza/54240c1922e4fbf790e1 to your computer and use it in GitHub Desktop.
Save Jartza/54240c1922e4fbf790e1 to your computer and use it in GitHub Desktop.
Euler Problem 67 solver in node :)
t=require('fs').readFileSync("triangle.txt","utf8").trim().split("\n");for(f in t)i=t[f]=t[f--].split(" ");for(;1+f;)for(s in w=t[f--])i[s]=+w[s]+Math.max(i[s],i[++s]);console.log(i[0])
@Jartza
Copy link
Author

Jartza commented Mar 15, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment