Sum of the count of number of adjacent squares in an M X N grid | function to calculate the sum of all cells adjacent value ; Driver Code
def summ ( m , n ) : NEW_LINE INDENT return 8 * m * n - 6 * m - 6 * n + 4 NEW_LINE DEDENT m = 3 NEW_LINE n = 2 NEW_LINE print ( summ ( m , n ) ) NEW_LINE