Leetcode in Java && Oracle
421 subscribers
8 photos
397 files
400 links
Second channel: @codeforces_java

Let's Develop Together!
Download Telegram
image_2021-12-22_03-19-23.png
23.8 KB
#N231. Power of Two
problem link

#solution
class Solution {
public boolean isPowerOfTwo(int n) {
if(n<1) return false;
if(n==1) return true;

if(n%2==0) return isPowerOfTwo(n/2);
return false;
}
}
👍2