Not an answer -
This ruined the Cody challenge for me.
I guessed the "minimun parse tree" requirement would exclude invoking functions of regular expressions and related stunts. Not because it is hard to do (which is), but because this has little to do with code improvement in terms of computability.
Anyway. Back to cody.