
public class ArrPal {

	public static boolean pal(int []a,int i,int j){
		if(i==j || i==j+1 || a.length==0)
			return true;
		
		if(j>a.length-1 || i<0)
			return false;
		//or make j=a.length-i-1; and remove j from parameter
		if(a[i]!=a[j])
			return false;
		else
			return (pal(a,++i,--j));
		
	}
	
	
	public static boolean pal(int []a){
		if(a.length==0 || a.length==1)
			return true;
		
		String s="";
		
		for(int i=0;i<a.length;++i)
			s+=a[i];
		
		 return palr(s);
		
	}
	
	
	public static boolean palr(String s){

		if(s.length()==1 || s.length()==0){
			return true;
		}
		char i=s.charAt(0);
		char j=s.charAt(s.length()-1);

		if(i!=j){
			return false;
		}


		else{
			
			return palr(s.substring(1,s.length()-1));
			
		}
	}
	public static void main(String[] args) {
		System.out.println(pal(new int []{0,1,2,3,3,2,1,0}));
	}

}
