The code requires to delete any duplicate integers inside the array but keeping it simple. Without system.arraycopy or anything complicated, can't use set or anything "beyond" loops in knowledge. It's a constructor that receives an array of numbers, should check if the numbers duplicate and create an array without duplicates
For example:
{1,2,5,5,2,4,5,1} Would be {1,2,5,4} So it should create an array with the size of the numbers not duplicated.
Tried to create a loop that counts if the number repeats itself and only if not then it will add it but it's not the best idea since it won't count numbers that are being repeated at least once
int repeat = 0;enter code here
int counter = 0;
if(se.length < 2)
{
System.out.println("Array smaller than 2, please change the size!");
return;
}
for(int i = 0; i < se.length; i++)
{
for(int j = 0; j < se.length; j++)
if(se[i] == se[j])
{
repeat++;
}
if(repeat == 0)
counter++;
repeat = 0;
}