May LeetCoding Challenge #Day4 #Number Complement #Java

    May LeetCoding Challenge[Day4] - Number Complement

    Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Input: 5 Output: 2 Explanation: The binary representation of 5 is 101 (no leading zero bits), and its complement is 010. 1. 알고리즘을 해결하기 위해서 생각한 방법 - 우선, 해당 문제는 5라는 값이 주어졌을 때, 이진 값으로 101이 되는데, 이 때 해당 값의 반대 되는 값을 return하면 된다. - 여기서, 해당 값의 반대 되는 값의 단어적 정의는 잘 모르겠고, complem..