Function to initialize the difference array
def intializeDiff ( D , A ) : NEW_LINE INDENT for i in range ( N ) : NEW_LINE INDENT D [ i ] [ 0 ] = A [ i ] [ 0 ] ; NEW_LINE D [ i ] [ M ] = 0 ; NEW_LINE DEDENT for i in range ( N ) : NEW_LINE INDENT for j in range ( 1 , M ) : NEW_LINE INDENT D [ i ] [ j ] = A [ i ] [ j ] - A [ i ] [ j - 1 ] ; NEW_LINE DEDENT DEDENT DEDENT