Easy · Math
Integer Power
Given a signed 64-bit base and integer exp ≤ 100, return base raised to the power exp: 1 when exp is 0 (0^0 included) and 0 when exp is negative. For nonnegative exp, the result is guaranteed to fit in a signed 64-bit integer.
Examples
Example 1
{
"base": 2,
"exp": 10
}Output: = 1024
Example 2
{
"base": 3,
"exp": 5
}Output: = 243
Rebuild it in the studio
Core interview problems are free with a full runner and lessons; Pro opens the complete library.