首页
mac
it
登录
6mi
u
盘
搜
搜 索
it
LeetCode No.476数字的补数
LeetCode No.476数字的补数
mac
2024-05-23
33
class
Solution
{
public
int
findComplement
(
int
num
)
{
int
i
=
0
,
result
=
0
;
while
(
num
>
0
)
{
if
(
num
%
2
==
0
)
{
result
+=
Math
.
pow
(
2
,
i
)
;
}
i
++
;
num
/=
2
;
}
return
result
;
}
}
%
79.69
%
74.64
转载请注明原文地址: https://mac.8miu.com/read-492180.html
最新回复
(
0
)