I try to solve the question using Recursion but I am not able to think how to make a pair Can anyone help me in the question .
Here I attch my code:-
public static int helper(int nums[],int i ,int j,int k,int l){
if(i >nums.length || j>nums.length || k>nums.length || l>nums.length){
return 0;
}
if(i==nums.length && j==nums.length && k==nums.length && l==nums.length){
return 1;
}
if(i!=j && j!=k && k!=l && (ij)==(kl)){
return 1;
}else{
int op1=helper(nums,i+1,j,k,l);
int op2=helper(nums,i,j+1,k,l);
int op3=helper(nums,i,j,k+1,l);
int op4=helper(nums,i,j,k,l+1);
// int op5=helper(nums,i+1,j+1,k+1,l+1);
return op1+op2+op3+op4;
}
}
Also attach the question Link :-
https://leetcode.com/problems/tuple-with-same-product/