You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This discussion was converted from issue #144 on September 15, 2026 11:13.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Problem link
https://leetcode.com/problems/number-complement/
Problem Summary
수가 주어질 때 complement를 구하는 문제.
Solution
1이 0이 되고 0이 1이 되려면?? XOR를 쓰면 된다.
자릿수를 올라가면서 1과 XOR를 하면 1은 0이 되고 0은 1이 된다.
Source Code
All reactions