Logo

Programming-Idioms

  • JS
  • Python

Idiom #312 Test for list equality

Set b to true if the lists p and q have the same size and the same elements, false otherwise.

b = p == q
#include <algorithm>
bool b = ::std::ranges::equal(p, q);

New implementation...
< >
programming-idioms.org