/**
 * @param {number} n
 * @return {boolean}
 */
var isPowerOfTwo = function(n) {
  if (n === 1) return true;
  var str = n.toString(2);

  return str.charAt(0) === '1' && parseInt(str.substr(1)) === 0;
};


var eq = require('assert').equal;

eq(isPowerOfTwo(2), true);
eq(isPowerOfTwo(1), true);
eq(isPowerOfTwo(4), true);

@@ -202,16 +202,121 @@
 0;%0A%7D;%0A%0A%0A
+// method 2%0A// bit manipulation%0Avar isPowerOfTwo = function(n) %7B%0A  return n %3E0  && (n & (n-1) === 0);%0A%7D;%0A
 var eq =

append another method