Prevent enter duplicate element to a vector | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Prevent enter duplicate element to a vector

Can anyone tell me how to make sure that it is not duplicated before entering an element into a vector?

7th Nov 2019, 3:29 PM
Maryam
7 Answers
+ 1
Its C++
7th Nov 2019, 3:38 PM
Maryam
+ 1
Its C++
7th Nov 2019, 3:38 PM
Maryam
+ 1
Ok thanks so much
7th Nov 2019, 3:42 PM
Maryam
+ 1
I dont understand you
7th Nov 2019, 4:47 PM
Maryam
0
Maryam What is your language preference?
7th Nov 2019, 3:36 PM
Avinesh
Avinesh - avatar
0
Maryam Someone will surely get back to you. If it was Java then I could have helped.
7th Nov 2019, 3:40 PM
Avinesh
Avinesh - avatar
0
Look up unique in the algorithm header file, u need to sort the vector first, also in the same header file.
7th Nov 2019, 5:42 PM
rodwynnejones
rodwynnejones - avatar