human
Counting pairs when a person can form pair with at most one | Python program to find Number of ways in which participant can take part ..
Driver code"
Solution in Python:
 ... Give me a code to counting pairs when a person can form pair with at most one and the other steps required?
assistant
#Here is code to counting pairs when a person can form pair with at most one and the other steps required.
 def numberOfWays ( x ) :
	dp = [ ]
	dp . append ( 1 )
	dp . append ( 1 )
	for i in range ( 2 , x + 1 ) :
		dp . append ( dp [ i - 1 ] + ( i - 1 ) * dp [ i - 2 ] )
	return ( dp [ x ] )
x = 3
print ( numberOfWays ( x ) )