I have no idea how to provide the input array
How to use ide platform
@ravindrarawat440 You have to use Scanner to take input as an Array like this :
//Take n i.e. the size of the array.
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
//now make an array of size n.
int[] ar = new int[n];
//now Initiate a for loop which will do n no. of iterations.
for(int i = 0; i < n; i++){
ar[i] = sc.nextInt();
}
that’s how you should take input and The input Array will be provided by the Compiler you don’t have to worry about that.
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.