Code not submitting

Code is not getting submitted for tilling problem 2

send me your code then only i will be able to help you

import java.util.*; class Main{ static int count=0; public static void main(String args[]){ Scanner scan=new Scanner(System.in); int N=scan.nextInt(); ArrayList result=new ArrayList<>(); for(int i=0;i<N;i++){ int n=scan.nextInt(); int m=scan.nextInt(); tile(n,m,0); result.add(count); count=0; } for(int a:result){ System.out.println(a); } } static void tile(int rows,int cols,int row){ if(row>rows+1)return; if(rows+1==row){ count++; return; } tile(rows,cols,row+1); tile(rows,cols,row+cols+1); } }

i am not able to send it in a proper manner

i have emailed you the code

firstly you have not declared the type of ArrayList.
the correct way to initialize it is ArrayList < Integer > result=new ArrayList<>();

further , try to optimize your code
Read the problem as a matrix of size M x N, rather than N x M as it helps in easy visualization.
In this manner,

A tile can be either place vertically,meaning it will only occupy a cell of width 1 and a complete hieght of M. Or,
You can place M tiles horizontally one over the other if there is enough width left.

https://ide.codingblocks.com/s/175840 here is my code

And sir my code is not getting submitted doesnt mean test cases failing. I am not able to submit it. Even processing is not showing

@sumitlohan buddy the code is working and it show correct for 1 testcase and timelimit exceeded for the rest.
if you are still facing issues with submission you can contact ([email protected]) for technical support.

Ok sir , ammm , i will try to reduce its complexity then again ask you if it will not submit. Thanks for assistance.

please mark your doubt resolved

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.