Calling for after choosing the current index value
v . add ( arr [ n - 1 ] ) ; int y = printAllSubsetsRec ( arr , n , v , sum - arr [ n - 1 ] ) ; v . remove ( v . size ( ) - 1 ) ; return Math . min ( x , y ) ; }