Solution to Pow(x, n) by LeetCode

5 Jun

Question: https://oj.leetcode.com/problems/powx-n/

Question Name: Pow(x, n)

The simplest solution is to use the build-in function “pow” or build-in operation “**” of Python.

A second simple solution is recursive.

Finally, a iterative solution works here.

Leave a Reply

Your email address will not be published. Required fields are marked *