示例#1
0
 def test_example2(self):
     self.assertEqual(0, binary_gap(15))
示例#2
0
 def test_large5(self):
     self.assertEqual(binary_gap(1073741825), 29)
示例#3
0
 def test_large6(self):
     self.assertEqual(binary_gap(1610612737), 28)
示例#4
0
 def test_example1(self):
     self.assertEqual(5, binary_gap(1041))
示例#5
0
 def test_large4(self):
     self.assertEqual(binary_gap(1376796946), 5)
示例#6
0
 def test_large2(self):
     self.assertEqual(binary_gap(74901729), 4)
示例#7
0
 def test_large3(self):
     self.assertEqual(binary_gap(805306369), 27)
示例#8
0
 def test_medium3(self):
     self.assertEqual(binary_gap(66561), 9)
示例#9
0
 def test_large1(self):
     self.assertEqual(binary_gap(6291457), 20)
示例#10
0
 def test_medium1(self):
     self.assertEqual(binary_gap(51712), 2)
     self.assertEqual(binary_gap(20), 1)
示例#11
0
 def test_medium2(self):
     self.assertEqual(binary_gap(561892), 3)
     self.assertEqual(binary_gap(9), 2)
示例#12
0
 def test_simple3(self):
     self.assertEqual(binary_gap(1162), 3)
     self.assertEqual(binary_gap(5), 1)
示例#13
0
 def test_simple2(self):
     self.assertEqual(binary_gap(19), 2)
     self.assertEqual(binary_gap(42), 1)
示例#14
0
 def test_simple1(self):
     self.assertEqual(binary_gap(9), 2)
     self.assertEqual(binary_gap(11), 1)
示例#15
0
 def test_trailing_zeros(self):
     self.assertEqual(binary_gap(6), 0)
     self.assertEqual(binary_gap(328), 2)
示例#16
0
 def test_extremes(self):
     self.assertEqual(0, binary_gap(1))
     self.assertEqual(1, binary_gap(5))