Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate elements from multiple input vectors at the same time #1801

Open
dimy-x opened this issue Nov 15, 2023 · 0 comments
Open

Remove duplicate elements from multiple input vectors at the same time #1801

dimy-x opened this issue Nov 15, 2023 · 0 comments

Comments

@dimy-x
Copy link

dimy-x commented Nov 15, 2023

Hello guys,

If we have the following input data vectors (same size dimension)

std::vector<int64_t> times = {1, 2, 1, 3, 4, 1, 2, 3, 4, 5};
std::vector doubles = {1.1, 2.1, 1.1001, 3.1, 4.1, 1.1, 2.1, 3.1, 4.1, 5.1};
std::vectorstd::string values = {"s1", "s2", "s1s1", "s3", "s4", "s1", "s2", "s3", "s4", "s5"};

I want to modify the original three vectors by removing the duplicates. I consider that there is duplicate if times[n] = times[k] && doubles[n] = doubles[k]

Is there an elegant and effitient solution with the range-v3 library ?

Many thanks in advance,
dimy-x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant