Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 483. Smallest Good Base
Given n (<= 1e18), find the smallest integer base k >= 2 such that n's base-k representation is all 1s — i.e., n = 1 + k + k^2 + ... + k^m for some m >= 1. This reduces to finding integer pairs (k, m) satisfying that geometric series equation and choosing the minimal k.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.