Available question text
Given k and x, define price(num) as the count of 1-bits in num at bit positions x, 2x, 3x, ... (LSB = position 1); the accumulated price up to N is the sum of price(i) for i=1..N. Return the largest N whose accumulated price ≤ k — the core challenge is efficiently computing these cumulative bit counts for large k (≤1e15) by exploiting the periodicity of bit patterns (x ≤ 8).
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 3007. Maximum Number That Sum of the Prices Is Less Than or Equal to K
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source