求下面矩阵的秩(rank)
求下面矩阵 $A_n$ 的秩(rank)
\[
A_n=\begin{pmatrix}
1-\frac{1}{n} & -\frac{1}{n} & \cdots & -\frac{1}{n} & -\frac{1}{n} \\
-\frac{1}{n} & 1-\frac{1}{n} & \cdots & -\frac{1}{n} & -\frac{1}{n} \\
\vdots & & \ddots & \vdots & \vdots \\
-\frac{1}{n} & -\frac{1}{n} & \cdots & 1-\frac{1}{n} & -\frac{1}{n}\\
-\frac{1}{n} & -\frac{1}{n} & \cdots & -\frac{1}{n} &1-\frac{1}{n} \\
\end{pmatrix}_{n\times n}
\]