Power of a Number
EasyAcceptance: N/A
Given two integers base and exponent, return base raised to the power of exponent.
Example 1:
Input: base = 2, exponent = 3
Output: 8
Explanation: 2^3 = 2 × 2 × 2 = 8
Example 2:
Input: base = 5, exponent = 0
Output: 1
Explanation: Any number to the power of 0 is 1
Constraints:
- -10 <= base <= 10
- 0 <= exponent <= 10
Discussion
Please login to view and join the discussion.
Login to ContinueLoading...
Status:Not run yet
Run your code to see results