human
Count ways to reach the nth stair using step 1 , 2 or 3 | A recursive function used by countWays.
Driver code"
Solution in Python:

=====
Write me a code to count ways to reach the nth stair using step 1 , 2 or 3 and the other steps required?
assistant
#Here is code to count ways to reach the nth stair using step 1 , 2 or 3 and the other steps required.
 def countWays ( n ) :
	res = [ 0 ] * ( n + 2 )
	res [ 0 ] = 1
	res [ 1 ] = 1
	res [ 2 ] = 2
	for i in range ( 3 , n + 1 ) :
		res [ i ] = res [ i - 1 ] + res [ i - 2 ] + res [ i - 3 ]
	return res [ n ]
n = 4
print ( countWays ( n ) )