import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
int []arr = new int [n];
for (int i = 0 ; i < n ; i++){
arr[i] = s.nextInt() ;
}
int z = 0 ;
for (int i = 0 ; i < n ; i++){
z = z ^ arr[i] ;
}
System.out.println(z + āis present only onceā);
}
}
What is wrong in this code ?
It is not passing both the testcases though I m getting right answer .
Unique Number - I
@Sejalrathi,
https://ide.codingblocks.com/s/188542 here is the corrected code.
Error: You donāt need to print āis present only onceā in the answer. Just print what is shown in the output of the question