+ 5
All your imports should be placed at the the very beginning of your program.. Also you don't need the class code?
import java.util.*;
public class Program
{
public static int recFunction(int A[]){
if(A.length == 1)
return A[0];
int m = A.length % 2;
int val1 = recFunction(Arrays.copyOfRange(A, 0, m + 1));
int val2 = recFunction(Arrays.copyOfRange(A, m + 1, A.length));
if (val1 > val2)
return val1 ;
return val2 ;
}
public static void main(String args[]){
int A[] = {21, 6, 145, 26, -2, 0, 9, 243, 15 };
System.out.println(recFunction(A));
}
}



