
15 Oct
2007
15 Oct
'07
1:52 p.m.
On Oct 15, 2007, at 7:59 , Felipe Lessa wrote:
On 10/15/07, apfelmus
wrote: lasts :: Int -> [a] -> [a] lasts n xs = head $ [x | (x,[]) <- zip (tails xs) (tails $ drop n xs)] (...) main n = print . sum . map read . lasts n . lines =<< getContents
But that's a a two-liner now heh =).
.oO { if you want Perl, you know where to find it... } -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH