Algorithm complexity similar to Selection Sort
You have to count. Intuition is necessary, but you must calculate.

$$ 1+2+\cdots+N-1 = N(N-1)/2 \in \mathcal{O}(N^2)$$ by Gaussian summation rules.

In asymptotic notation, the constants are removed. For example.

$\mathcal{O}(N/k) = \mathcal{O}(N)$ as long as $k$ is a constant.