Sum of length of two smallest subsets possible from a given array with sum at least K

import java.io.*;
import java.lang.*;
import java.util.*;

class GFG{

static int MAX = (int)(1e9);

static int MinimumLength(int A[], int N, int K)
{
     
    
    Arrays.sort(A);
     
    
    int suffix[] = new int[N + 1];

    
    for(int i = N – 1; i >= 0; i–)
        suffix[i] = suffix[i + 1] + A[i];

    
    int dp[][] = new int[N + 1][K + 1];

    
    
    for(int i = 0; i = 0; j–)
        {
             
            
            
            
            if (j = 0; i–)
    {
         
        
        if (suffix[i] – dp[i][K] >= K)
        {
             
            
            
            return N – i;
        }
    }

    
    
    return -1;
}

public static void main(String[] args)
{
    int arr[] = { 7, 4, 5, 6, 8 };
    int K = 13;
    int N = arr.length;

    System.out.println(MinimumLength(arr, N, K));
}
}