Required condition
else if ( data . get ( 0 ) >= target ) return 1 ; else if ( data . get ( 0 ) < target ) { List < Integer > temp = new ArrayList < > ( ) ; for ( int i = 1 ; i < data . size ( ) ; i ++ ) temp . add ( data . get ( i ) ) ; return Math . min ( smallSumSubset ( temp , target , maxVal ) , 1 + smallSumSubset ( temp , target - data . get ( 0 ) , maxVal ) ) ; } return - 1 ; }