Print "e"
is even faster, but also missed the point.
is even faster, but also missed the point.
not that i have anything against the approaches here - the dynamic programming approach over trees is really cool and i probably wouldn't have thought of it myself. i just thought it amusing that there seemed to be a simpler way.