Exactly three adjacent 3 in lists: Difference between revisions
m
→{{header|Haskell}}
Line 93:
=={{header|Haskell}}==
<lang haskell>import Data.Bifunctor (bimap)
import Data.List (
nnPeers :: Int -> [Int] -> Bool
nnPeers n xs =
(not . any p)
(span p (dropWhile (not . p) xs))
where
p x =
▲ uncurry (&&) $
▲ bimap
▲ (not . any p)
--------------------------- TEST -------------------------
|