My issue
im doing pairwise xor and producting with every value and at last see if it is in interval
My code
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc = new Scanner(System.in);
int T = sc.nextInt(); // Number of test cases
while (T-- > 0) {
int N = sc.nextInt(); // Array size
int L = sc.nextInt(); // Lower bound
int R = sc.nextInt(); // Upper bound
int[] A = new int[N];
for (int i = 0; i < N; i++) {
A[i] = sc.nextInt();
}
long product = 1;
loop1:
for(int i = 0 ; i < N ; i++){
for(int j = i+1 ; j < N ; j++){
product *= A[i]^A[j];
if(product > R){
break loop1;
}
}
}
if(product < L || product > R){
System.out.println("NO");
}else{
System.out.println("YES");
}
}
}
}
Problem Link: Halloween Array Practice Coding Problem