Regarding the input

How can i take input as testcase and under that number n and then n will consists of a[n] array as an input…?

Hey this is how we do that
int t;
cin>>t;
while(t–){
int n;
cin>>n;
int*arr=new int[n];
for(int i=0;i<n;i++)cin>>arr[i];
//rest of the code

}

Hey @shubhankar1996.dob1
I hope your doubt is resolved ,if its then please mark it as resolved :slight_smile:
If its not then let me know the issue.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.