new files
This commit is contained in:
parent
3af7344581
commit
86c034bb8b
1364 changed files with 21352 additions and 0 deletions
11
Task/Ordered-words/Haskell/ordered-words-3.hs
Normal file
11
Task/Ordered-words/Haskell/ordered-words-3.hs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import Control.Monad (liftM)
|
||||
|
||||
isSorted wws@(_ : ws) = and $ zipWith (<=) wws ws
|
||||
|
||||
getLines = liftM lines . readFile
|
||||
|
||||
main = do
|
||||
ls <- getLines "unixdict.txt"
|
||||
let ow = filter isSorted ls
|
||||
let maxl = foldr max 0 (map length ow)
|
||||
print $ filter (\w -> (length w) == maxl) ow
|
||||
Loading…
Add table
Add a link
Reference in a new issue