Skip to content

Instantly share code, notes, and snippets.

@thesoftwarejedi
Created May 6, 2014 20:48
Show Gist options
  • Save thesoftwarejedi/223424719d28588a7f50 to your computer and use it in GitHub Desktop.
Save thesoftwarejedi/223424719d28588a7f50 to your computer and use it in GitHub Desktop.
q.Aggregate(new{b=1,c=w,x=1},(l,o)=>l.x<0?l:o=='W'?new{b=1,c=l.c+l.b,x=1}:new{b=l.b*2,c=l.c-l.b,x=(l.c-l.b)-(l.b*2)}).c;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment