Suppose in an array, there is the numbers {1,1,1,1,1,5} How do I write a program that does not specifically relate to the numbers(ex. no printing {1,5}) that gets rid of all the repeating numbers in this array?
In other words, if the problem was {a,b,c,d,e} and I without me knowing the numbers inside, how do I write a program in Java that gets rid of all the repeating digits?(the example on the very top's answer would be {1,5})