[Solved] Power of two failed to pass the test
[ad_1] Are you sure that you are checking power of 2? Rather, being checked divisible with 2. If you are serious, use the piece of cake snippet return n > 0 && ((n & -n) == n); The second way, private static boolean powerOf2(int num) { if(num <= 0){ return false; } while(num > 1) … Read more