Can’t you run it?
g[ss[i]]++;
can be rewritten as
int index = ss[i];
g[index] = g[index] + 1;
So it’s counted number of each number in ss.
It’s very error prone, and you should never do something like that.
2
solved java array printing the repeated numbers , array in the array [closed]