LC 50

Pow(x, n)

Medium · LC 1–100

mathrecursion
Free

Candidate solution routes

Primary

Modular arithmetic and fast power

Free

Invariant: During binary power, result*base^exp remains congruent to the original target; each step consumes one bit.

candidate confidence: 0.565 · metadata_only

How to use this page

Read the statement and constraints first, then validate recognition signals, invariant, and complexity. Candidate score is not correctness evidence.