kyu_5.find_the_smallest package

Submodules

kyu_5.find_the_smallest.solution module

Solution for -> Find the smallest.

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

kyu_5.find_the_smallest.solution.concat_new_n(digits: list, min_digit: int, min_index: int) list[source]

Find new n.

Parameters:
  • digits – list

  • min_digit – int

  • min_index – int

Returns:

list

kyu_5.find_the_smallest.solution.get_min_digit(digits: list) int[source]

Find min digit.

Parameters:

digits – list

Returns:

int

kyu_5.find_the_smallest.solution.smallest(n: int) list[source]

Smallest function.

Return an array or a tuple or a string depending on the language (see “Sample Tests”) with:

  1. The smallest number you got.

  2. The index i of the digit d you took, i as small as possible.

3. The index j (as small as possible) where you insert this digit d to have the smallest number.

Parameters:

n – a positive number n consisting of digits

Returns:

an array with: smallest number, index, digit

kyu_5.find_the_smallest.test_smallest module

Test for -> Find the smallest.

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

class kyu_5.find_the_smallest.test_smallest.FindSmallestTestCase(methodName='runTest')[source]

Bases: TestCase

Testing smallest function.

_classSetupFailed = False
_class_cleanups = []
pytestmark = [Mark(name='skip', args=(), kwargs={'reason': 'The solution is not ready'})]
test_smallest = None
test_smallest_00(**kw)

Testing smallest function with various test data [with n=261235, expected=[126235, 2, 0]].

Test a function smallest which will return an array or a tuple or a string depending on the language (see “Sample Tests”). :return:

test_smallest_01(**kw)

Testing smallest function with various test data [with n=209917, expected=[29917, 0, 1]].

Test a function smallest which will return an array or a tuple or a string depending on the language (see “Sample Tests”). :return:

test_smallest_02(**kw)

Testing smallest function with various test data [with n=285365, expected=[238565, 3, 1]].

Test a function smallest which will return an array or a tuple or a string depending on the language (see “Sample Tests”). :return:

test_smallest_03(**kw)

Testing smallest function with various test data [with n=269045, expected=[26945, 3, 0]].

Test a function smallest which will return an array or a tuple or a string depending on the language (see “Sample Tests”). :return:

test_smallest_04(**kw)

Testing smallest function with various test data [with n=296837, expected=[239687, 4, 1]].

Test a function smallest which will return an array or a tuple or a string depending on the language (see “Sample Tests”). :return:

test_smallest_05(**kw)

Testing smallest function with various test data [with n=935855753, expected=[358557539, 0, 8]].

Test a function smallest which will return an array or a tuple or a string depending on the language (see “Sample Tests”). :return:

test_smallest_06(**kw)

Testing smallest function with various test data [with n=346674147588841927, expected=[134667414758884927, 14, 0]].

Test a function smallest which will return an array or a tuple or a string depending on the language (see “Sample Tests”). :return:

test_smallest_07(**kw)

Testing smallest function with various test data [with n=352343279580894007, expected=[35234327958089407, 15, 0]].

Test a function smallest which will return an array or a tuple or a string depending on the language (see “Sample Tests”). :return:

test_smallest_08(**kw)

Testing smallest function with various test data [with n=633814808310045545, expected=[63381480831045545, 11, 0]].

Test a function smallest which will return an array or a tuple or a string depending on the language (see “Sample Tests”). :return:

test_smallest_09(**kw)

Testing smallest function with various test data [with n=71269954474326234, expected=[12679954474326234, 0, 3]].

Test a function smallest which will return an array or a tuple or a string depending on the language (see “Sample Tests”). :return:

test_smallest_10(**kw)

Testing smallest function with various test data [with n=400360725952391834, expected=[3460725952391834, 0, 3]].

Test a function smallest which will return an array or a tuple or a string depending on the language (see “Sample Tests”). :return:

test_smallest_11(**kw)

Testing smallest function with various test data [with n=914459749498173781, expected=[144597494981737819, 0, 17]].

Test a function smallest which will return an array or a tuple or a string depending on the language (see “Sample Tests”). :return:

test_smallest_12(**kw)

Testing smallest function with various test data [with n=113343536213382181, expected=[111334353621338218, 17, 0]].

Test a function smallest which will return an array or a tuple or a string depending on the language (see “Sample Tests”). :return:

test_smallest_13(**kw)

Testing smallest function with various test data [with n=614132919143656569, expected=[141326919143656569, 0, 5]].

Test a function smallest which will return an array or a tuple or a string depending on the language (see “Sample Tests”). :return:

Module contents

Find the smallest.