Jump to content

Exactly three adjacent 3 in lists: Difference between revisions

m
Line 76:
Or (same test and results):
 
<lang haskell>import Data.ListBifunctor (elemIndexbimap)
import Data.List (elemIndex)
 
nnPeers :: Int -> [Int] -> Bool
Line 83 ⟶ 84:
p = (n ==)
go i =
letuncurry (a, b&&) = splitAt n (drop i xs)$
bimap
in all p a && not (any p b)</lang>
(all p)
(not . any p)
in all p a &&(splitAt notn (anydrop pi bxs))</lang>
 
=={{header|Julia}}==
9,659

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.