Exactly three adjacent 3 in lists: Difference between revisions

→‎{{header|Factor}}: Fix the code allowing four threes, while the task says we need "exactly three" of them
(→‎{{header|Factor}}: Further simplify the solution and format the output according to the task description)
(→‎{{header|Factor}}: Fix the code allowing four threes, while the task says we need "exactly three" of them)
Line 1,030:
{ 4 6 8 7 2 3 3 3 1 }
}
[
[ { 3 3 3 } subseq-of? "true" "false" ? print ] each</syntaxhighlight>
[ [ 3 = ] count 3 = ]
[ { 3 3 3 } subseq-of? ]
bi and "true" "false" ? print
] each</syntaxhighlight>
{{out}}
<pre>
8

edits