We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b82603 commit cd6f744Copy full SHA for cd6f744
README.md
@@ -49,6 +49,10 @@ Step 2. Add the dependency
49
50
<summary>展开查看</summary>
51
52
+https://leetcode.cn/problems/complement-of-base-10-integer
53
+
54
+https://leetcode.cn/problems/number-complement
55
56
https://leetcode.cn/problems/ransom-note
57
58
https://leetcode.cn/problems/valid-perfect-square
complement-of-base-10-integer/index.ts
@@ -0,0 +1,7 @@
1
+function bitwiseComplement(n: number): number {
2
+ return parseInt(
3
+ n.toString(2).split("").map((a) => a === "0" ? "1" : "0").join(""),
4
+ 2,
5
+ );
6
+}
7
+export default bitwiseComplement;
number-complement/index.ts
@@ -0,0 +1 @@
+export { default } from "../complement-of-base-10-integer/index.ts";
0 commit comments