Java tutorial
//package com.java2s; import java.util.ArrayList; public class Main { public static int[] CountElmt(ArrayList<Integer> newScores1, ArrayList<Integer> scores) { int a[] = new int[scores.size()]; for (int i = 0; i < scores.size(); i++) { a[i] = 0; } for (int i = 0; i < newScores1.size(); i++) { int value = newScores1.get(i); int pos = scores.indexOf(value); a[pos]++; } return a; } }