whats the problem in my code??
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int T=sc.nextInt();
for(int i=0;i<T;i++){
System.out.println("enter the no.s - ");
int n=sc.nextInt();
int m=sc.nextInt();
System.out.println(combination(n,m));
}
}
public static int combination(int n,int m){
int[] count =new int[n+1];
count[0]=0;
for(int i=1;i<=n;i++){
if(i<m || i==1){
count[i]=1;
}else if(i>m){
count[i] = count[i-1] + count[i-m];
}else{
count[i]=2;
}
}
return count[n];
}
}
THIS IS MY code
question is this –
Given a floor of size n x m. Find the number of ways to tile the floor with tiles of size 1 x m . A tile can either be placed horizontally or vertically.
Link of the question —
https://online.codingblocks.com/app/player/162100/content/158840/5208/code-challenge