human
K | Function that finds the Nth element of K - Fibonacci series.
If N is less than K then the element is '1.
first k elements are 1.
( K + 1 ) th element is K.
find the elements of the K - Fibonacci series.
subtract the element at index i - k - 1 and add the element at index i - i from the sum ( sum contains the sum of previous ' K ' elements ).
set the new sum.
Driver code.
get the Nth value of K - Fibonacci series"
How can the above be solved in Python?

=====
What is a code to k and the other steps required?
assistant
#Here is code to k and the other steps required.
 def solve ( N , K ) :
	Array = [ 0 ] * ( N + 1 )
'
	if ( N <= K ) :
		print ( "1" )
		return
	i = 0
	sm = K
	for i in range ( 1 , K + 1 ) :
		Array [ i ] = 1
	Array [ i + 1 ] = sm
	for i in range ( K + 2 , N + 1 ) :
		Array [ i ] = sm - Array [ i - K - 1 ] + Array [ i - 1 ]
		sm = Array [ i ]
	print ( Array [ N ] )
N = 4
K = 2
solve ( N , K )