
10 Apr
2008
10 Apr
'08
8:25 p.m.
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