Available question text
Flip every bit in n's binary representation up to its most significant 1 (i.e., ignore leading zeros) and return the resulting integer.
Example: 5 (101) -> complement 2 (010).
Related questions
Continue with questions that share topics or the same question type.
- Convert Integer to String in Given Base
Coding
- Add to Array-Form of Integer
Coding
- Base 7
Coding
- Closest Fair Integer
Coding
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 1009. Complement of Base 10 Integer
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source