In julia we can check if an array contains a value, like so:
> 6 in [4,6,5]
true
However this returns false, when attempting to check for a sub-array in a specific order:
> [4,6] in [4,6,5]
false
What is the correct syntax to verify if a specific sub-array exists in an array?
4
and the first result. – Selfrespectsubsets
, and you can write[4,6] in subsets([4,5,6])
. – VisionalA
(not considerA
as a whole sequence) is included in another arrayB
,setdiff(A, B) |> isempty
is sufficient to do the job. – Visional