Here is the result of my dynamic-programmed cookie monster:
$ time ruby challenge.rb
ESSESSSSSSESSEESEEEEEE = 74
real 0m0.022s
user 0m0.012s
sys 0m0.008s
(ibook G4)
$ wc -lc challenge.rb
50 1521 challenge.rb
Same path as in Robert's solution.
regards,
quentin