includes

Performs a parallel linear scan of setA and setB from [0 .. N$(RP) where N = min(setA.length, setB.length), returning true if setA includes all elements in setB and false if not. Both setA and setB are required to be sorted, and duplicates in setB require an equal number of duplicates in setA. Comparisons will be performed using the supplied predicate or '<' if none is supplied.

bool
includes
()
(
in T[] setA
,
in T[] setB
,
Pred pred = Pred.init
)

Parameters

setA T[]

The sorted array to evaluate.

setB T[]

The sorted array to match against.

pred Pred

The evaluation predicate, which should return true if e1 is less than e2 and false if not. This predicate may be any callable type.

Return Value

Type: bool

True if setA includes all elements in setB, false if not.

Examples

test(includes("abcdefg", "cde"));

Meta