Exactly three adjacent 3 in lists: Difference between revisions

m
(→‎{{header|Python}}: Added a version in Python)
Line 125:
 
=={{header|Julia}}==
{{incorrect|Julia|Will incorrectly pass for a list with '''more''' than 3 consecutive '3's}}
<lang julia>function consecutivein(a::Vector{T}, lis::Vector{T}) where T
function consecutivein(a::Vector{T}, lis::Vector{T}) where T
return anylength(findall(i -> a == lis[i:i+length(a)-1], 1:length(lis)-length(a)+1)) == 1
end
 
end
 
4,108

edits