Comment detail

リストの並び (Nested Flatten)

This comment is reply for 6429 kozima: 書いてみたら意外とすっきり。(リストの並び). Go to thread root.

Haskell の方がきれいに書けますね。

1
2
3
4
import Data.List

check (x:xs) = (all (< x) xs || all (> x) xs) && check xs
check []     = True

Index

Feed

Other

Link

Pathtraq

loading...