human
Find the number of good permutations | Function to return the count of good permutations.
For m = 0 , ans is 1.
If k is greater than 1.
If k is greater than 2.
If k is greater than 3.
Driver code"
How can the above be solved in Python?
assistant
#Here is code to find the number of good permutations and the other steps required.
 def Permutations ( n , k ) :
	ans = 1
	if k >= 2 :
		ans += ( n ) * ( n - 1 ) // 2
	if k >= 3 :
		ans += ( ( n ) * ( n - 1 ) * ( n - 2 ) * 2 // 6 )
	if k >= 4 :
		ans += ( ( n ) * ( n - 1 ) * ( n - 2 ) * ( n - 3 ) * 9 // 24 )
	return ans
if __name__ == " _ _ main _ _ " :
	n , k = 5 , 2
	print ( Permutations ( n , k ) )