Doubt in chessboard question on hackerblocks

what is wrong in this code???

package HACKERBLOCKS;

import java.util.Scanner;

public class chessboard {

public static void main(String[] args) {
	
	Scanner scn=new Scanner(System.in);
	int n=scn.nextInt();
	int [][] arr=new int[n][n];
	chessboard1(arr,0,0,n-1,n-1,"");
	System.out.println();
	System.out.println(chessboard1count(arr,0,0,n-1,n-1));
	

}
public static void chessboard1(int [][] arr,int cc, int cr,int ec,int er,String ans) {
	
	if (cc==ec && cr==er) {
		System.out.print(ans+"{"+er+"-"+ec+"}"+" ");
		return;
	}
	if (cc>ec || cr>er) {
		return;
	}
	
	//knights
	chessboard1(arr,cc+2,cr+1,ec,er,ans+"{"+cr+"-"+cc+"}k");
	chessboard1(arr,cc+1,cr+2,ec,er,ans+"{"+cr+"-"+cc+"}k");
	//rook
	if (cc==0 || cr==0 || cc==ec ||cr==er) {
		for (int step=1;step<=er-cr;step++) {
			chessboard1(arr,cc,cr+step,ec,er,ans+"{"+cr+"-"+cc+"}R");
		}
		for (int step=1;step<=ec-cc;step++) {
			chessboard1(arr,cc+step,cr,ec,er,ans+"{"+cr+"-"+cc+"}R");
		}
		
	}
	if (cc==cr || cc+cr==ec) {
		for (int step=1;step<=ec-cc &&step<=ec-cc;step++) {
			chessboard1(arr,cc+step,cr+step,ec,er,ans+"{"+cr+"-"+cc+"}b");
		}
		
	}
	
	
	
	
}

public static int chessboard1count(int [][] arr,int cc, int cr,int ec,int er) {

	if (cc==ec && cr==er) {
		
		return 1;
	}
	if (cc>ec || cr>er) {
		return 0;
	}
	int res=0;
	//knights
	res +=chessboard1count(arr,cc+2,cr+1,ec,er);
	res +=chessboard1count(arr,cc+1,cr+2,ec,er);
	//rook
	if (cc==0 || cr==0 || cc==ec ||cr==er) {
		for (int step=1;step<=er-cr;step++) {
			res +=chessboard1count(arr,cc,cr+step,ec,er);
		}
		for (int step=1;step<=ec-cc;step++) {
			res +=chessboard1count(arr,cc+step,cr,ec,er);
		}
		
	}
	if (cc==cr || cc+cr==ec) {
		for (int step=1;step<=ec-cc &&step<=ec-cc;step++) {
			res +=chessboard1count(arr,cc+step,cr+step,ec,er);
		}
		
	}
	return res;
	
	
	
}

}

Hey @harsh.hj
Please Past the Question Link

sir i have done this question

@harsh.hj
mast Bhai Please mark your doubts as resolved in your course’s