Skip to content

Commit 35a2f55

Browse files
authored
Update and rename Power of three.java to Power of Three.java
1 parent 3744abb commit 35a2f55

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

Easy/Power of Three.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Solution {
2+
public boolean isPowerOfThree(int n) {
3+
if (n <= 0) {
4+
return false;
5+
}
6+
while (n > 1) {
7+
if (n % 3 != 0) {
8+
return false;
9+
}
10+
n /= 3;
11+
}
12+
return true;
13+
}
14+
}

Easy/Power of three.java

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)