All Problems

Number Complement

EasybitsExpected: O(log n) time, O(1) spaceInterview Context
bit-manipulation

Problem

Given a positive integer, return its complement by flipping all bits in its binary representation.

Loading...