human
Count N | Function to count N - length strings consisting of vowels only sorted lexicographically.
Stores count of strings consisting of vowels sorted lexicographically of all possible lengths.
Initialize DP [ 1 ] [ 1 ].
Traverse the matrix row - wise.
Base Case.
Return the result.
Driver Code.
Function Call"
How can the above be solved in Python?
assistant
#Here is code to count N and the other steps required.
 def findNumberOfStrings ( n ) :
	DP = [ [ 0 for i in range ( 6 ) ] for i in range ( n + 1 ) ]
	DP [ 1 ] [ 1 ] = 1
	for i in range ( 1 , n + 1 ) :
		for j in range ( 1 , 6 ) :
			if ( i == 1 ) :
				DP [ i ] [ j ] = DP [ i ] [ j - 1 ] + 1
			else :
				DP [ i ] [ j ] = DP [ i ] [ j - 1 ] + DP [ i - 1 ] [ j ]
	return DP [ n ] [ 5 ]
if __name__ == ' _ _ main _ _ ' :
	N = 2
	print ( findNumberOfStrings ( N ) )