codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
import Control.Monad import Data.List test = [3,2,6,4,5,1] lsbs cs = filter ((==ml) . length) sortonly where sortonly = filter (\a -> sort a == a) (subs cs) ml = maximum $ map length sortonly subs cs = filterM (\a -> [True, False]) cs main = print $ lsbs test
Private
[
?
]
Run code
Submit