kyu_7.find_the_longest_gap package¶
Submodules¶
kyu_7.find_the_longest_gap.gap module¶
kyu_7.find_the_longest_gap.test_gap module¶
-
class
kyu_7.find_the_longest_gap.test_gap.
GapTestCase
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Testing gap function
-
test_gap
()[source]¶ Testing gap function with various test inputs
A binary gap within a positive number num is any sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of num.
The gap function should return the length of its longest binary gap.
The function should return 0 if num doesn’t contain a binary gap. :return:
-