@@ -0,0 +1,856 @@
+package easy;%0A/**231. Power of Two  QuestionEditorial Solution  My Submissions%0ATotal Accepted: 90169%0ATotal Submissions: 237048%0ADifficulty: Easy%0AGiven an integer, write a function to determine if it is a power of two.*/%0Apublic class PowerOfTwo %7B%0A    public boolean isPowerOfTwo(int n) %7B%0A        //after writing out the binary representation of some numbers: 1,2,4,8,16,32, you can easily figure out that%0A        //every number that is power of two has only one bit that is 1%0A        //then we can apply that cool trick that we learned from %7B@link easy.NumberOfIBits%7D: n&(n-1) which will clear the least significant bit in n to zero%0A        if(n %3C= 0) return false;%0A        return (n&(n-1)) == 0;%0A    %7D%0A    %0A    public static void main(String...strings)%7B%0A        PowerOfTwo test = new PowerOfTwo();%0A        System.out.println(test.isPowerOfTwo(14));%0A    %7D%0A%7D%0A

power of two