human
Median of all non | Function to calculate the median of all possible subsets by given operations.
Stores sum of elements of arr [ ].
Traverse the array arr [ ].
Update sum.
Sort the array.
DP [ i ] [ j ] : Stores total number of ways to form the sum j by either selecting ith element or not selecting ith item ..
Base case.
Fill dp [ i ] [ 0 ].
Base case.
Fill all the DP states based on the mentioned DP relation.
If j is greater than or equal to arr [ i ].
Update dp [ i ] [ j ].
Update dp [ i ] [ j ].
Stores all possible subset sum.
Traverse all possible subset sum.
Stores count of subsets whose sum is j.
Itearate over the range [ 1 , M ].
Insert j into sumSub.
Stores middle element of sumSub.
Driver Code"
Solution in Python:

Write me a code to median of all non and the other steps required?
assistant
#Here is code to median of all non and the other steps required.
 def findMedianOfsubSum ( arr , N ) :
	sum = 0
	for i in range ( N ) :
		sum += arr [ i ]
	arr . sort ( reverse = False )
	dp = [ [ 0 for i in range ( sum + 1 ) ] for j in range ( N ) ]
	for i in range ( N ) :
		dp [ i ] [ 0 ] = 1
	dp [ 0 ] [ arr [ 0 ] ] = 1
	for i in range ( 1 , N , 1 ) :
		for j in range ( 1 , sum + 1 , 1 ) :
			if ( j >= arr [ i ] ) :
				dp [ i ] [ j ] = ( dp [ i - 1 ] [ j ] + dp [ i - 1 ] [ j - arr [ i ] ] )
			else :
				dp [ i ] [ j ] = dp [ i - 1 ] [ j ]
	sumSub = [ ]
	for j in range ( 1 , sum + 1 , 1 ) :
		M = dp [ N - 1 ] [ j ]
		for i in range ( 1 , M + 1 , 1 ) :
			sumSub . append ( j )
	mid = sumSub [ len ( sumSub ) // 2 ]
	return mid
if __name__ == ' _ _ main _ _ ' :
	arr = [ 2 , 3 , 3 ]
	N = len ( arr )
	print ( findMedianOfsubSum ( arr , N ) )