kyu_8.find_the_first_non_consecutive_number package

Submodules

kyu_8.find_the_first_non_consecutive_number.first_non_consecutive module

Solution for -> Find the first non-consecutive number.

Created by Egor Kostan. GitHub: https://github.com/ikostan

kyu_8.find_the_first_non_consecutive_number.first_non_consecutive.first_non_consecutive(arr: list) int | None[source]

Find the first element of an array that is not consecutive.

E.g. If we have an array [1,2,3,4,6,7,8] then 1 then 2 then 3 then 4 are all consecutive but 6 is not, so that’s the first non-consecutive number.

If the whole array is consecutive then return null or Nothing. :param arr: list :return: int

kyu_8.find_the_first_non_consecutive_number.test_first_non_consecutive module

Test for -> Find the first non-consecutive number.

Created by Egor Kostan. GitHub: https://github.com/ikostan

class kyu_8.find_the_first_non_consecutive_number.test_first_non_consecutive.FirstNonConsecutiveTestCase(methodName='runTest')[source]

Bases: TestCase

Testing first_non_consecutive function.

_classSetupFailed = False
_class_cleanups = []
test_first_non_consecutive_large_list()[source]

Testing large lists.

Returns:

test_first_non_consecutive_negative()[source]

Test non-consecutive is a negative number.

Returns:

test_first_non_consecutive_none()[source]

Testing first_non_consecutive function, non-consecutive numbers.

If the whole array is consecutive then return null or Nothing or None. :return:

test_first_non_consecutive_positive()[source]

Test non-consecutive positive numbers.

If we have an array [1,2,3,4,6,7,8] then 1 then 2 then 3 then 4 are all consecutive but 6 is not, so that’s the first non-consecutive number. :return:

Module contents

Find the first non-consecutive number.