Calculating number of decreasing path from each cell .
for i in range ( n ) : NEW_LINE INDENT for j in range ( n ) : NEW_LINE INDENT sum += CountDecreasingPathsCell ( mat , dp , n , i , j ) NEW_LINE DEDENT DEDENT return sum NEW_LINE