Tap here to switch tabs
Problem
Submissions

Problem: Complement of Base 10 Integer

Complement of Base 10 Integer gives a nonnegative base-ten integer and asks you to return the base-ten value formed by flipping every bit in its binary representation.

Statement

For any nn positive number in base 10, return the complement of its binary representation as an integer in base 10.

Constraints

  • 0≤n≤1090 \leq n \leq 10^9
⋮
Tap here to switch tabs
Problem
Submissions

Problem: Complement of Base 10 Integer

Complement of Base 10 Integer gives a nonnegative base-ten integer and asks you to return the base-ten value formed by flipping every bit in its binary representation.

Statement

For any nn positive number in base 10, return the complement of its binary representation as an integer in base 10.

Constraints

  • 0≤n≤1090 \leq n \leq 10^9