comefrom: <awangdev>Copy Books_2.java
code: public int copyBooks(int[] pages, int K) {
          if (pages == null || pages.length == 0) {
              return 0;
          }
  
          int n = pages.length;
          if (K > n) {
              K = n;
          }
          int[][] dp = new int[K + 1][n + 1];
  
          dp[0][0] = 0; 
          for (int i = 1; i <= n; i++) {
              dp[0][i] = Integer.MAX_VALUE;
          }
          
          for (int k = 1; k <= K; k++) { 
              for (int i = 1; i <= n; i++) {
                  int sum = 0;
                  dp[k][i] = Integer.MAX_VALUE;
                  for (int j = i; j >= 0; j--) { 
                      dp[k][i] = Math.min(dp[k][i], Math.max(dp[k - 1][j], sum));
                      if (j > 0) {
                          sum += pages[j - 1];
                      }
                  }
              }
          }
  
          return dp[K][n];
      }
masked: public int sample_funcname ( int [ ] var_0 , int var_1 ) {
    if ( var_0 == null || var_0 . length == 0 ) {
      return 0 ;
    }
    int var_2 = var_0 . length ;
    if ( var_1 > var_2 ) {
      var_1 = var_2 ;
    }
    int [ ] [ ] var_3 = new int [ var_1 + 1 ] [ var_2 + 1 ] ;
    var_3 [ 0 ] [ 0 ] = 0 ;
    for ( int var_4 = 1 ;
    var_4 <= var_2 ;
    var_4 ++ ) {
      var_3 [ 0 ] [ var_4 ] = Integer . MAX_VALUE ;
    }
    for ( int var_5 = 1 ;
    var_5 <= var_1 ;
    var_5 ++ ) {
      for ( int var_4 = 1 ;
      var_4 <= var_2 ;
      var_4 ++ ) {
        int var_6 = 0 ;
        var_3 [ var_5 ] [ var_4 ] = Integer . MAX_VALUE ;
        for ( int var_7 = var_4 ;
        var_7 >= 0 ;
        var_7 -- ) {
          var_3 [ var_5 ] [ var_4 ] = Math . min ( var_3 [ var_5 ] [ var_4 ] , Math . max ( var_3 [ var_5 - 1 ] [ var_7 ] , var_6 ) ) ;
          if ( var_7 > 0 ) {
            var_6 += var_0 [ var_7 - 1 ] ;
          }
        }
      }
    }
    return var_3 [ var_1 ] [ var_2 ] ;
  }
  