My approach was purely of hit and trial method, since I could see that the question is solved with it with relative ease:
$1+2+3+...+(m-1)+m = k^2$ [Let]
Putting $m=1$
$1=1^2$
Also,
$1+2+3+...+(n-1)+n=l^2$ [Let]
Putting $n=8$
$36=6^2$
Hence $m+n=9$
Since this question was relatively simple and straightforward, it could be done with simple hit and trial. However, I want to learn an algebraic approach to it such that it could be applied to more complex questions as well.