Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

intersection function

The elements that are in every one of some lists.

How to write it

intersection(a, b, ...)

a
A list. Takes a list.
b
A list. Takes a list.

Examples

  • intersection⁡([1,2],[2,3])=[2]\displaystyle \operatorname{intersection}(\left[ 1, 2 \right], \left[ 2, 3 \right]) = \left[ 2 \right]
    intersection([1, 2], [2, 3])

    In the solver, intersection([1, 2], [2, 3]) gives [2].

    Open in the solver
  • join

    Join lists into one.

  • head

    The head of an expression: the name of the function it is a call of.

  • last

    The last element of a list.

  • fold_list

    The steps of fold: every partial result, starting from the first value.

  • length

    Number of elements in a list.

  • fold

    Combine the elements of a list from the left with a function, starting from a value.