As in the linked question, this can be achieved by using the Woodbury Identity, which is:
$$(A + UCV)^{-1} = A^{-1} - A^{-1}U[C^{-1}+VA^{-1}U]^{-1}VA^{-1}$$
First, swap the rows and columns in $C$ in such a way that $C= \begin{bmatrix} c & c'_i \\ c'_j & B \end{bmatrix}$, which does not fundamentally alter the matrix or it's inverse (For each swapped row, the respective columns in the inverse are swapped, and vic cersa).
At this point, you can do $B - A = \begin{bmatrix} d_{1,1} & ... & d_{1, n} \\ \vdots & 0\\d_{n, 1} & \end{bmatrix}$, which will be $UCV$ (different $C$) in the Woodbury Identity. It clearly has rank 2: The first row is linearly independent from all others, while all others are trivially linearly dependet. So this matrix is of rank two, which means that it is a rank two update, which means $U \in \mathbb{R}^{n \times 2}, V \in \mathbb{R}^{2 \times n}$.
$C$ can be the identity $I_n$, while $U, V$ are $U = \begin{bmatrix}
1 & 0 \\
0 & d_{2, 1} \\
\vdots & \vdots \\
0 & d_{n, 1} \\
\end{bmatrix}, V = \begin{bmatrix}
d_{1, 1} & d_{1, 2} & ... & d_{1, n} \\
1 & 0 & ... & 0
\end{bmatrix}$
Having found U, C and V, the identity can be resolved with a single $2\times2$-Inversion and a number of matrix multiplications. Take care that the swapping of rows is either irrelevant or taken into account/reverted in later steps.