Math & Geometry · Medium
Pow(x, n)
O(log N) · O(1)
Step 1: Setup & Initialization - Pow(x, n)
Binary exponentiation: square base x and halve exponent n at each step.
Array Elements & Pointers
10
[0]20
[1]30
[2]40
[3]50
[4]Live Variables & Invariants
status:Initialized
pattern:Pow(x, n)
Step 1 / 3
33%
Solution Code
LeetCode IDE Console
Test Cases
3 cases from Blind 75 & NeetCode 150
Ask for a hint whenever you get stuck.