Outer Loop $\Rightarrow$

Now,
Inside the rectangle : j values are $\rightarrow$
$\begin{align*} j = 1,3,6,10,15,21....... n \end{align*}$

Assuming we have m terms in that series.
From above image :
- To get the $6th$ term we add $6$ to the previous term.
- So, to get the $mth$ term we add $m$ in the last increment step.
- $mth$ term is = $n$
$$\begin{align*} &\Rightarrow n = 1+2+3+4+5+6+......m \\ &\Rightarrow n = \frac{m(m+1)}{2} \\ &\Rightarrow m = O(\sqrt{n}) \end{align*}$$
Considering inner + outer loop $ \Rightarrow$ $O(\sqrt{n}*\log n)$