Skip to content

Commit fde6a7b

Browse files
committed
adding java solution to problem 342. Power of Four
1 parent 3666524 commit fde6a7b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

java/342-Power-of-Four.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Solution {
2+
public boolean isPowerOfFour(int n) {
3+
double x = Math.log(n)/Math.log(4);
4+
return x==(int)x;
5+
}
6+
}

0 commit comments

Comments
 (0)