non increasing subsequence by jonathan camacho

#!perl -lp
@m=@c=();for$i(split//){@c=($#c<0||$c[$#c]<$i)?($i):(@c,$i);@m=$#c>$#m?@c:@m}$_=join"",@m

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page