LeetCode_1021_ Complement of Base 10 Integer

求十进制数的反码 通过观察可知,输入与输出的关系为: Input+Output= 其中n为使Input+Output成立的最小m值 class Solution { public: int bitwiseComplement(int N) { if(N<=1) return 1-N; int cnt=1; while(cnt<=N) cnt=cnt*2;
相关文章
相关标签/搜索