bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
MediumMath & GeometryLC 50

Pow(x, n)

Efficient x^n.

Asked at 15 companies
AdobeAmazonApple
Hints
  • 1.Think about what data structure fits Pow(x, n)
  • 2.Consider the brute force complexity and how to optimize
  • 3.Can you trade space for time?
LeetCodeNeetCode