Sponsored
Use these hints if you're stuck. Try solving on your own first.
A binary number plus its complement will equal 111....111 in binary. Also, N = 0 is a corner case.
Solve with full IDE support and test cases