human
Number of non | return number of non negative integral solutions.
initialize total = 0.
Base Case if n = 1 and val >= 0 then it should return 1.
iterate the loop till equal the val.
total solution of equations and again call the recursive function Solutions ( variable , value ).
return the total no possible solution.
driver code"
How can the above be solved in Python?
assistant
#Here is code to number of non and the other steps required.
 def countSolutions ( n , val ) :
	total = 0
	if n == 1 and val >= 0 :
		return 1
	for i in range ( val + 1 ) :
		total += countSolutions ( n - 1 , val - i )
	return total
n = 5
val = 20
print ( countSolutions ( n , val ) )