# Operations it takes to invert a matrix

I had this question on a homework and I was wondering if my thinking was correct.

if you have a nxn matrix, how many total arithmetic operations do you perform? ( +,-, *, /)...I went about this saying that first you must perform n number of operations on the first row then n number of operations on the remaining rows. So, I got n^2. But I am not exactly sure if this is the way to go about it and I was wondering if this was the same as two nested for-loops going through a 2d array.

-
Hint: One can compute the inverse of an $n\times n$ non-singular matrix using Gauss-Jordan elimination. What is the op-count of Gauss-Jordan elimination?