[Deleted] 3y
Can anybody please tell me why am I getting WA for all the test cases?
Works in BlueJ.
import java.util.*;class ZCO14{public static void main(String[] args){Scanner s = new Scanner(System.in);int n = s.nextInt();long[] list = new long[n];int[] freq = new int[n];for(int i = 0; i < n; i++) {list[i] = s.nextLong(); freq[i] = 1;}Arrays.sort(list);for(int i = 1; i < n; i++){if(list[i] == list[i-1]){
Read more… (18 words)