Exactly three adjacent 3 in lists: Difference between revisions
Content added Content deleted
Line 76: | Line 76: | ||
Or (same test and results): |
Or (same test and results): |
||
<lang haskell>import Data. |
<lang haskell>import Data.Bifunctor (bimap) |
||
import Data.List (elemIndex) |
|||
nnPeers :: Int -> [Int] -> Bool |
nnPeers :: Int -> [Int] -> Bool |
||
Line 83: | Line 84: | ||
p = (n ==) |
p = (n ==) |
||
go i = |
go i = |
||
uncurry (&&) $ |
|||
bimap |
|||
⚫ | |||
(all p) |
|||
(not . any p) |
|||
⚫ | |||
=={{header|Julia}}== |
=={{header|Julia}}== |