full coding bat, without debug prints

public int maxMirror(int[] nums) { return compute(nums) ; } public int[] getReverse(int a[]){ int len = a.length ; int res[] = new int[len] ; for(int j = 0 , i = a.length-1; i >= 0 ; i--,j++) res[j] = a[i] ; return res ; } public int compute(int a[]){ if(a.length == 0) return 0 ; if (a.length == 1) return 1 ; int reverse[] = getReverse(a) ; int maxspan = 1 ; if(a.length == compareArrays(reverse,a)){ return a.length ;} for(int sub_size = 2 ; sub_size < a.length;sub_size++ ){ int currentspan = 0 ; for(int from = 0 ; from <= a.length - sub_size; from++){ int rev_sub[] = makeArray(reverse, from , sub_size) ; for(int from2 = 0 ; from2 <= a.length - sub_size ; from2++){ int a_sub[] = makeArray(a, from2,sub_size) ; currentspan = compareArrays(rev_sub,a_sub) ; if(currentspan > maxspan){ maxspan = currentspan ;} } } } return maxspan ; } public int[] makeArray(int a[], int from, int n){ int len = n ; int result[] = new int[len] ; int count = 0 ; for(int i = from;from <= a.length-n && i < from + n ;i++){ result[count] = a[i] ; count++ ; } return result ; } public int compareArrays(int array1[], int array2[]){ for(int i = 0 ; i < array1.length; i++){ if(array1[i] != array2[i]) return 0 ; } return array1.length ; }