There was an error while loading. Please reload this page.
1 parent f6dbc61 commit 3a4e802Copy full SHA for 3a4e802
1 file changed
leetcode3/김민제/476_Number_Complement.py
@@ -0,0 +1,8 @@
1
+def solution(num):
2
+ num_bin = bin(num)[2:]
3
+ str_bin = str(num_bin)
4
+ return int(str_bin.replace('1','x').replace('0','1').replace('x','0'),2)
5
+
6
7
8
+print(solution(1))
0 commit comments