3 ms·
http://www.fzort.org/mpr/junk/greplin-3.pl.txt http://www.fzort.org/mpr/junk/greplin-3.pl.txt Perl, 7s. Looks like I arrived at the same recurrence that madars
by fzort 16y ago
http://www.fzort.org/mpr/junk/greplin-3.pl.txt http://www.fzort.org/mpr/junk/greplin-3.pl.txt
Perl, 7s. Looks like I arrived at the same recurrence that madars used, but I swear I didn't look at his solution...
Memoize magically turns it from exponential to polynomial.