human
Count N digits numbers with sum divisible by K | Function to count the N digit numbers whose sum is divisible by K.
Base case.
If already computed subproblem occurred.
Store the count of N digit numbers whoe sum is divisible by K.
Check if the number does not contain any leading 0..
Recurrence relation.
Driver code.
Stores the values of overlapping subproblems"
Solution in Python:

=====
Write me a code to count N digits numbers with sum divisible by K and the other steps required?
assistant
#Here is code to count N digits numbers with sum divisible by K and the other steps required.
 def countNum ( N , sum , K , st , dp ) :
	if ( N == 0 and sum == 0 ) :
		return 1
	if ( N < 0 ) :
		return 0
	if ( dp [ N ] [ sum ] [ st ] != - 1 ) :
		return dp [ N ] [ sum ] [ st ]
	res = 0
	start = 1
	if ( st == 1 ) :
		start = 0
	else :
		start = 1
	for i in range ( start , 10 ) :
		min = 0
		if ( ( st i ) > 0 ) :
			min = 1
		else :
			min = 0
		res += countNum ( N - 1 , ( sum + i ) % K , K , min , dp )
		dp [ N ] [ sum ] [ st ] = res
	return dp [ N ] [ sum ] [ st ]
if __name__ == ' _ _ main _ _ ' :
	N = 2
	K = 7
	M = 100
	dp = [ [ [ - 1 for i in range ( 2 ) ] for j in range ( M ) ] for j in range ( M ) ]
	print ( countNum ( N , 0 , K , 0 , dp ) )