Write a function to calculate the power of a number using a divide-and-conquer approach (exponentiation by squaring)
HardProblem Statement
Write a function to calculate the power of a number using a divide-and-conquer approach (exponentiation by squaring)
Sample Input
2, 10
Sample Output
1024
Limits
Time: 2s · Memory: 256 MB