Skip to content

Instantly share code, notes, and snippets.

@Jartza
Last active August 29, 2015 13:57
t=require('fs').readFileSync("tree.txt","utf8").split("\n");for(f in t)i=t[f]=t[f--].split(" ");for(;f;)for(s in w=t[f--])i[s]=+w[s]+Math.max(i[s],i[++s]);console.log(i[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment