Array symmetric difference

Write a function that returns a sorted vector with the symmetric
difference of two sorted vectors v₁ and v₂. The result must have the
elements in v₁ that are not in v₂ and the elements in v₂ that are not in
v₁, without repetitions. For example, the symmetric difference of a
vector with 1, 2, 2, 5, 5, 7 and a vector with 2, 3, 3, 7 is a vector
with 1, 3, 5.

Interface

    vector<double> symmetric_difference(const vector<double>& v1, const vector<double>& v2);

Observation

You only need to submit the required procedure; your main program will
be ignored.

Problem information

Author: Gabriel Valiente

Generation: 2026-01-25T14:28:50.813Z

© Jutge.org, 2006–2026.
https://jutge.org
