https://hack.codingblocks.com/app/contests/2854/1916/problemCount of different ways to express N as the sum of 1, 3 and 4

import java.util.*;
public class Main {

public static void main (String args[]) {
    Scanner sc= new Scanner(System.in);
    int N=sc.nextInt();
	int[] dp= new int[N+1];
	dp[0]=1;
	System.out.print(ways(N,dp));
}
public static int  ways(int N,int[] dp){
    if(N<0){
        return 0;
    }
	if(dp[N]!=0){
        return dp[N];
	}
	
     int a=ways(N-1,dp);
	 int b=ways(N-3,dp);
	 int c=ways(N-4,dp);
	 dp[N]=(a+b+c);
	 return dp[N];

}

this code is notworking for all test cases??

Hi @ravipratapcs19_081b72f7c7693fc8

Please use the slack channel to post your doubts for the Live batch.