Here is the interview question prompt, presented for reference.
Given a number x
and an integer n
, find the value of x
raised to the power n
( xn ).
![image](https://storage.googleapis.com/algodailyrandomassets/curriculum/misc/power-of-a-number/problem.png)
For example, consider the following two numbers,
x = 2.1, n = 3
If the number 2.1
is multiplied by itself 3
times, then the answer is 9.261 (rounded to the nearest 100), which is 2.1
raised to the power 3
.
You can see the full challenge with visuals at this link.
Challenges • Asked about 2 years ago by Jake from AlgoDaily
This is the main discussion thread generated for Power of a Number (Main Thread).