human
Count rows with sum exceeding sum of the remaining Matrix | ''Function to count the number of rows whose sum exceeds the sum of elements of the remaining matrix.
'' Stores the matrix dimensions.
'' To store the result.
'' Stores the total sum of  the matrix elements.
'' Calculate the total sum.
'' Traverse to check for each row.
'' Stores the sum of elements  of the current row.
'' Calculate the sum of elements  of the current row.
'' If sum of current row exceeds  the sum of rest of the matrix.
'' Increase count.
'' Print the result.
''Driver Code.
'' Given matrix.
'' Function call"
How can the above be solved in Python?
assistant
#Here is code to count rows with sum exceeding sum of the remaining Matrix and the other steps required.
 def countRows ( mat ) :
	n = len ( mat )
	m = len ( mat [ 0 ] )
	count = 0
	totalSum = 0
	for i in range ( n ) :
		for j in range ( m ) :
			totalSum += mat [ i ] [ j ]
	for i in range ( n ) :
		currSum = 0
		for j in range ( m ) :
			currSum += mat [ i ] [ j ]
		if ( currSum > totalSum - currSum ) :
			count += 1
	print ( count )
if __name__ == ' _ _ main _ _ ' :
	mat = [ [ 2 , - 1 , 5 ] , [ - 3 , 0 , - 2 ] , [ 5 , 1 , 2 ] ]
	countRows ( mat )