my code compile fine but none of the test cases run…
please find the problem in my code and tell me
Where is the problem in my code?
https://ide.codingblocks.com/s/227156 corrected code.
You have to take separate inputs of array size for each test case. You had taken the same input, that’s why the error.
int n = sc.nextInt();
int[] arr = new int[n];
The above lines should be inside the while loop in the main method.