Max length bitonic subarray

import java.util.*;
public class Main {
static int bitonic(int arr[], int n)
{
int[] inc = new int[n]; // Length of increasing subarray ending
// at all indexes
int[] dec = new int[n]; // Length of decreasing subarray starting
// at all indexes
int max;

    // Length of increasing sequence ending at first index is 1 
    inc[0] = 1; 

    // Length of increasing sequence starting at first index is 1 
    dec[n-1] = 1; 

    // Step 1) Construct increasing sequence array 
    for (int i = 1; i < n; i++) 
       inc[i] = (arr[i] >= arr[i-1])? inc[i-1] + 1: 1; 
	   // Step 2) Construct decreasing sequence array 
    for (int i = n-2; i >= 0; i--) 
        dec[i] = (arr[i] >= arr[i+1])? dec[i+1] + 1: 1; 

    // Step 3) Find the length of maximum length bitonic sequence 
    max = inc[0] + dec[0] - 1; 
    for (int i = 1; i < n; i++) 
        if (inc[i] + dec[i] - 1 > max) 
            max = inc[i] + dec[i] - 1; 

    return max; 
} 

/*Driver function to check for above function*/
public static void main (String[] args) 
{ 
    Scanner sc=new Scanner(System.in);
    int n = sc.nextInt(); 
	int testcases=sc.nextInt();
	while(testcases>0){
		int[] arr=new int[n];
		for(int i=0;i<n;i++){
			arr[i]=sc.nextInt();
		}
		int p;
		p=bitonic(arr,n);
    System.out.println(bitonic(p)); 
	testcases--;
} 

}
}
showing 1 error ,plz help to solve

hey @karthik1989photos
just a change
System.out.println( p );
instead of System.out.println(bitonic( p));
Why are you doing the same thing every time

i corrected that error buy mistake i thought to keep one error but i kept different
import java.util.*;
public class Main {
static int bitonic(int arr[], int n)
{
int[] inc = new int[n]; // Length of increasing subarray ending
// at all indexes
int[] dec = new int[n]; // Length of decreasing subarray starting
// at all indexes
int max;

    // Length of increasing sequence ending at first index is 1 
    inc[0] = 1; 

    // Length of increasing sequence starting at first index is 1 
    dec[n-1] = 1; 

    // Step 1) Construct increasing sequence array 
    for (int i = 1; i < n; i++) 
       inc[i] = (arr[i] >= arr[i-1])? inc[i-1] + 1: 1; 
	   // Step 2) Construct decreasing sequence array 
    for (int i = n-2; i >= 0; i--) 
        dec[i] = (arr[i] >= arr[i+1])? dec[i+1] + 1: 1; 

    // Step 3) Find the length of maximum length bitonic sequence 
    max = inc[0] + dec[0] - 1; 
    for (int i = 1; i < n; i++) 
        if (inc[i] + dec[i] - 1 > max) 
            max = inc[i] + dec[i] - 1; 

    return max; 
} 

/*Driver function to check for above function*/
public static void main (String[] args) 
{ 
    Scanner sc=new Scanner(System.in);
    int n = sc.nextInt(); 
	int testcases=sc.nextInt();
	while(testcases>0){
		int[] arr=new int[n];
		for(int i=0;i<n;i++){
			arr[i]=sc.nextInt();
		}
		int p;
		p=bitonic(arr,n);
    System.out.println(p); 
	testcases--;
} 

}
}
here compilation was succesful but on submitting it went wrong

@karthik1989photos
you are doing wrong
correct code:

sir compilation successful but on submitting testcases went wrong

getting TLE error on submitting the above code

hey @karthik1989photos
I’m so sorry. I have sent the wrong link. The above link is a solution to another problem. It’s my fault
correct link: