1class Solution {2 public boolean isPowerOfTwo(int n) {3 return power2(0, n);4 }56 public boolean power2(int index, int n) {7 if (Math.pow(2, index) == n) return true;8 if (Math.pow(2, index) > n) return false;9 return power2(index + 1, n);10 }11}
WPM •0 •0
ACC •0 •0
TIME •0