Practice Problem
Pow(x, n)
Difficulty: Medium
Implement pow(x, n), which calculates x raised to the power n (i.e., x^n). Use binary exponentiation (fast power) to achieve O(log n) time complexity.
Practice Problem
Difficulty: Medium
Implement pow(x, n), which calculates x raised to the power n (i.e., x^n). Use binary exponentiation (fast power) to achieve O(log n) time complexity.