Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Find Length Of Longest Ascending/Descending Sequence

by Fletch (Chancellor)
on May 10, 2011 at 19:08 UTC ( #904017=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    import Data.List (sort,tails)
    
    ...
                 "16060437323320876543354855484294170848344644764967947362
    +3104",
                 "78796640372485356789004027625810549218342470476191585852
    +4942",
                 "23456532982436100867707549226413076264717737053820267894
    +9041" ]
    
  2. or download this
    $ runhaskell ascruns.hs
    (5,"21098")
    ...
    (6,"876543")
    (6,"567890")
    (5,"23456")
    
  3. or download this
    longestSeq p s = maximum tuples
                     where ts = tails s
    ...
    (5,12,"21098")
    (5,37,"45678")
    (5,35,"67890")
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://904017]
help
Chatterbox?
[Corion]: 1nickt: I bought a 2015 XPS 13, which is a very nice and shiney (and somewhat overpriced) machine, but I think it's still better priced than an Apple machine. Now it just has to hold up 10 years like the old one did ;)
[1nickt]: Ah, you got Linus' fave? With Ubuntu? 4k display?
[1nickt]: ( The 17" monster I just bought is for my wife, who doesn;t leave the house with it...)
[Corion]: 1nickt: No, I'm using it with Windows 10, but with the 4k display, yes. It's a very nice build IMO, and relatively sturdy. Also, it got 8 or 9 on the ifixit repair scale, which I consider good
[Corion]: ... especially as I expect to have to replace the battery set in two or three years' time

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (12)
As of 2017-03-27 13:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (320 votes). Check out past polls.