Function to generate the required matrix
def solve ( n ) : NEW_LINE INDENT initial_array = [ [ 0 for i in range ( n - 1 ) ] for j in range ( n - 1 ) ] NEW_LINE final_array = [ [ 0 for i in range ( n ) ] for j in range ( n ) ] NEW_LINE for i in range ( n - 1 ) : NEW_LINE INDENT initial_array [ 0 ] [ i ] = i + 1 NEW_LINE DEDENT DEDENT