Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. 給一個正整數,算出他的二補數 (2's complement). 二補數就是將該數字的二進制碼全部翻轉過來. Note: The given integer is guaranteed to fit within the range of…
Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: The given integer is guaranteed to fit within the range of a 32-bit signed integer. You could assume no leading ze…
Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: The given integer is guaranteed to fit within the range of a 32-bit signed integer. You could assume no leading ze…