human
Count of subsets having sum of min and max element less than K | Function that return the count of subset such that min ( S ) + max ( S ) < K.
Sorting the array.
ans stores total number of subsets.
Add all possible subsets between i and j.
Decrease the sum.
Driver code"
Solution in Python:

Write me a code to count of subsets having sum of min and max element less than K and the other steps required?
assistant
#Here is code to count of subsets having sum of min and max element less than K and the other steps required.
 def get_subset_count ( arr , K , N ) :
	arr . sort ( )
	left = 0 ;
	right = N - 1 ;
	ans = 0 ;
	while ( left <= right ) :
		if ( arr [ left ] + arr [ right ] < K ) :
			ans += 1 << ( right - left ) ;
			left += 1 ;
		else :
			right -= 1 ;
	return ans ;
arr = [ 2 , 4 , 5 , 7 ] ;
K = 8 ;
print ( get_subset_count ( arr , K , 4 ) )