Pow(x, n)
Medium
Math
Math
Recursion
Implement pow(x, n). Handle negative exponents.
Constraints
x is float, -2^31 ≤ n ≤ 2^31-1
Examples
Example 1:
Input: 2.00000
10
Output: 1024.00000
Example 2:
Input: 2.10000
3
Output: 9.26100
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console