Easy · Math

Power X of Y

Given integers base and exp, return base raised to the power exp as a 64-bit integer: 1 when exp is 0 (0^0 included) and 0 when exp is negative.

Examples

Example 1

{
  "base": 2,
  "exp": 10
}

Output: = 1024

Example 2

{
  "base": 3,
  "exp": 5
}

Output: = 243

Rebuild it in the studio

Read every interview problem free. Ten rooms need no account. A token opens a problem in full — Pro never counts.

More Math problems