We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c3440dd commit 5c48ee3Copy full SHA for 5c48ee3
3 files changed
leetcode/Study Plan/231. 2 的幂/1.py
@@ -0,0 +1,3 @@
1
+class Solution:
2
+ def isPowerOfTwo(self, n: int) -> bool:
3
+ return n > 0 and (n&(n-1) ) == 0
leetcode/Study Plan/231. 2 的幂/2.cpp
@@ -0,0 +1,6 @@
+class Solution {
+public:
+ int addDigits(int num) {
4
+ return num > 0 ? (num-1)%9 + 1 : 0;
5
+ }
6
+};
leetcode/Study Plan/231. 2 的幂/2.py
+ def addDigits(self, num: int) -> int:
+ return (num-1) % 9 + 1 if num else 0
0 commit comments