I know that the sum $1+2+3+\cdots+(n-1)$ equals $\frac{(n-1)\cdot n}{2}$.
I wrote the equation in the two following forms:
$$(n-1)\cdot \frac{n}{2}=k^2$$ $$(n-1)\cdot n=2k^2$$
And I tried to find solutions by trial-and-error. I found $50$ through the first and $9$ through the second equation; and there seems to be no other solution as the answer to the question was $2$.
However, I certainly believe that there is a much more structured and methological method to solve the question that I am unfortunately unaware of.
How would you go about solving this question? Any help/hint/clue/solution would be greatly appreciated. Thanks.