Skip to content

Commit a9a433f

Browse files
committed
Roughly commit
1 parent 6d540bf commit a9a433f

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
package com.fibers.algorithm.leetcode._172;
2+
23
public class Solution {
4+
public int trailingZeroes(int n) {
5+
return n <= 0 ? 0 : n / 5 + trailingZeroes(n / 5);
6+
}
37
}
4-
8+
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
package com.fibers.algorithm.leetcode._231;
2+
23
public class Solution {
4+
public boolean isPowerOfTwo(int n) {
5+
return (n > 0) && (n & (n - 1)) == 0;
6+
}
37
}
4-
8+
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
package com.fibers.algorithm.leetcode._326;
2+
23
public class Solution {
4+
public boolean isPowerOfThree(int n) {
5+
return n > 0 && (1162261467 % n == 0);
6+
}
37
}
4-
8+

0 commit comments

Comments
 (0)