Wow, that stack thing is clever! It didn't even occur to me that you could evaluate as you go in a single pass through the polymer. Implementing the stack in c# (from the impl i posted below) went from ~2:50 => 268ms :O
~2:50 => 268ms
Cool! Yeah -- it's kind of a play on this classic problem, which is how I recognized it!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.