> liss = maximumBy length . filter ascending . concat . map inits . tails
Of course my solution is braindamaged since I skipped this bit of the
definition: [quote]Note that subsequence we are searching for is not
necessarily contiguous[/quote]. Like the article says, without this detail
the problem is quite trivial =P
Replace
concat . map inits . tails
with
foldr (\x xss -> xss ++ map (x:) xss) [[]]
for a correct (yet even more inefficient) solution.
I'd blame the mistake on the late hour, but it was even later when I
noticed... *shame*
--
Ariel J. Birnbaum
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe