human
Perfect Sum Problem | Function to print the subsets whose sum is equal to the given target K.
Create the new array with size equal to array set [ ] to create binary array as per n ( decimal number ).
Convert the array into binary array.
Calculate the sum of this subset.
Check whether sum is equal to target if it is equal , then print the subset.
Function to find the subsets with sum K.
Calculate the total no . of subsets.
Run loop till total no . of subsets and call the function for each subset.
Driver code"
Solution in Python:

Write me a code to perfect Sum Problem and the other steps required?
assistant
#Here is code to perfect Sum Problem and the other steps required.
 def sumSubsets ( sets , n , target ) :
	x = [ 0 ] * len ( sets ) ;
	j = len ( sets ) - 1 ;
	while ( n > 0 ) :
		x [ j ] = n % 2 ;
		n = n // 2 ;
		j -= 1 ;
	sum = 0 ;
	for i in range ( len ( sets ) ) :
		if ( x [ i ] == 1 ) :
			sum += sets [ i ] ;
	if ( sum == target ) :
		print ( " { " , end = " " ) ;
		for i in range ( len ( sets ) ) :
			if ( x [ i ] == 1 ) :
				print ( sets [ i ] , end = " , ▁ " ) ;
		print ( " } , ▁ " , end = " " ) ;
def findSubsets ( arr , K ) :
	x = pow ( 2 , len ( arr ) ) ;
	for i in range ( 1 , x ) :
		sumSubsets ( arr , i , K ) ;
if __name__ == " _ _ main _ _ " :
	arr = [ 5 , 10 , 12 , 13 , 15 , 18 ] ;
	K = 30 ;
	findSubsets ( arr , K ) ;