I am new to Java. I was reading someone's solution to a question and I encountered this:
int[] ps = new int[N];
for (int i = 0; i < N; i++)
ps[i] = input.nextInt();
int[] counts = new int[1005];
for (int p : ps)
counts[p]++;
What do the last two lines do?