public void IsPowerOfTwoTest() { var s = new Solution(); Assert.True(s.IsPowerOfTwo(1)); Assert.True(s.IsPowerOfTwo(16)); Assert.False(s.IsPowerOfTwo(218)); // Test case 1085/1108 Assert.False(s.IsPowerOfTwo(1073741825)); // Test case 1086/1108 Assert.False(s.IsPowerOfTwo(2147483646)); }
static void Main(string[] args) { Solution s = new Solution(); Console.Write(s.IsPowerOfTwo(8)); }