If dp [ j ] is true then print
System . out . print ( 0 + " ▁ " ) ; for ( int j = 0 ; j <= maxSum ; j ++ ) { if ( dp [ j ] == true ) System . out . print ( j + " ▁ " ) ; } System . out . print ( "21" ) ; }