a^2 * b^3 = 1323
= 27 * 49
=3^3 * 7^2
by equating the two, a=7 and b=3
I got this by knowing I needed a cube and a square, so I guess I technically trial and error-ed it. Sometimes you can do this in math, you just need to know what to look for, and that it can't possibly be too big a number in this question.
Here I would look at the cubes of numbers first, 1323 by each and see which one gives you a perfect square as well.