50. Pow(x, n)
Medium
Implement pow(x, n), which calculates x
raised to the power n
(i.e., xn
).
Example 1:
Example 2:
Example 3:
Constraints:
-100.0 < x < 100.0
-231 <= n <= 231-1
-104 <= xn <= 104
Last updated
Implement pow(x, n), which calculates x
raised to the power n
(i.e., xn
).
Example 1:
Example 2:
Example 3:
Constraints:
-100.0 < x < 100.0
-231 <= n <= 231-1
-104 <= xn <= 104
Last updated