Solution for Pow(x, n)