Find the number of squares inside the given square grid | Function to return the number of squares inside an n * n grid ; Driver code
def cntSquares ( n ) : NEW_LINE INDENT return int ( n * ( n + 1 ) * ( 2 * n + 1 ) / 6 ) NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT print ( cntSquares ( 4 ) ) ; NEW_LINE DEDENT