How to remove duplicate value in array? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 3

How to remove duplicate value in array?

Without deleting the first value.. šŸ˜ŠšŸ˜Š

27th Apr 2018, 2:29 AM
Bulb
Bulb - avatar
2 Respostas
+ 3
In Java and C++ you can use a set, which by definition has no duplicates. Here's a solution for JavaScript: https://stackoverflow.com/questions/9229645/remove-duplicate-values-from-js-array?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
27th Apr 2018, 2:36 AM
Emma
0
You create an array of elements you've already seen.
27th Apr 2018, 4:38 AM
Timon PaƟlick