human
Maximize the sum of Kth column of a Matrix | Function to maximize the Kth column sum.
Store all the elements of the resultant matrix of size N * N.
Store value of each elements of the matrix.
Fill all the columns < K.
Fill all the columns >= K.
Function to print the matrix.
Driver Code"
Solution in Python:
assistant
#Here is code to maximize the sum of Kth column of a Matrix and the other steps required.
 def findMatrix ( N , K ) :
	mat = [ [ 0 for i in range ( N ) ] for j in range ( N ) ] ;
	element = 0 ;
	for i in range ( 0 , N ) :
		for j in range ( 0 , K - 1 ) :
			element += 1 ;
			mat [ i ] [ j ] = element ;
	for i in range ( 0 , N ) :
		for j in range ( K - 1 , N ) :
			element += 1 ;
			mat [ i ] [ j ] = element ;
	return mat ;
def printMatrix ( mat , N ) :
	for i in range ( 0 , N ) :
		for j in range ( 0 , N ) :
			print ( mat [ i ] [ j ] , end = " ▁ " ) ;
		print ( ) ;
if __name__ == ' _ _ main _ _ ' :
	N = 3 ; K = 2 ;
	mat = findMatrix ( N , K ) ;
	printMatrix ( mat , N ) ;