D
Dylan
I'd like to compare two containers. They should be considered
equivalent if both containers have the same number of elements with
the same values, no matter what order the values are in.
For instance the containers
A = [1, 2, 3]
B = [1, 2, 3]
are obviously equal, but so would be
A = [3, 2, 1]
B = [2, 1, 3]
as would
A = [2, 2, 5, 1]
B = [2, 1, 5, 2]
What's the best (quickest) way of comparing containers in this way?
equivalent if both containers have the same number of elements with
the same values, no matter what order the values are in.
For instance the containers
A = [1, 2, 3]
B = [1, 2, 3]
are obviously equal, but so would be
A = [3, 2, 1]
B = [2, 1, 3]
as would
A = [2, 2, 5, 1]
B = [2, 1, 5, 2]
What's the best (quickest) way of comparing containers in this way?