ok so the program gets a list of numbers, and it counts how many times a number is entered.
for(int i = 0; i < numList.size(); i++){
for(int j = numList.size() - 1; j > i; j--){
if(numList.get(i) == numList.get(j)){
count++;
numList.remove(j);
}
}
System.out.println(numList.get(i) +" " + count);
count = 1;
}
this works except if i were to enter a number that's 100 or greater, it doesn't work which is weird.
for example, if i entered: 23, 23, 5, 3.
it would output:
23 2
5 1
3 1
this is correct
this doesn't work if i were to enter 100 or 500 or anything greater than 100.
input: 500, 500, 2, 5.
output:
500 1
500 1
2 1
5 1