Fast exponentiation


This is my code for fast exponentiation. Why is this giving a TLE?

@tanyaa.sood
Using divide and conquer technique we can observe the following recurrence
power(x, n) = power(x, n / 2) * power(x, n / 2); // else n is even
power(x, n) = x * power(x, n / 2) * power(x, n / 2); // if n is odd

reference code: