```
class Solution {
public boolean isPowerOfTwo(int n) {
return n > 0 && 1073741824 % n == 0;
}
}
```

This solution is based on the solution for isPowerOfThree.

Here, first we calculate highest integer which is a power of 2, not in the solution of code but outside the scope of our answer so that it does not affect the time complexity of our solution. This number comes out to be 1073741824. Later, we just check if the given number is greater than 0 and is completely divisible by the former calculated number.