kyu_6.casino_chips package

Submodules

kyu_6.casino_chips.solve module

Solution for Casino chips.

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

kyu_6.casino_chips.solve.solve(arr: list) int[source]

Solve function.

You are given three piles of casino chips: white, green and black chips:

the first pile contains only white chips the second pile contains only green chips the third pile contains only black chips

Each day you take exactly two chips of different colors and head to the casino. You can chose any color, but you are not allowed to take two chips of the same color in a day.

You will be given an array representing the number of chips of each color and your task is to return the maximum number of days you can pick the chips. Each day you need to take exactly two chips.

Parameters:

arr

Returns:

kyu_6.casino_chips.test_solve module

Test for Casino chips.

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

class kyu_6.casino_chips.test_solve.SolveTestCase(methodName='runTest')[source]

Bases: TestCase

Testing solve function.

_classSetupFailed = False
_class_cleanups = []
test_solve = None
test_solve_00(**kw)

Testing ‘solve’ function with various test data [with arr=[8, 8, 8], expected=12].

Returns:

test_solve_01(**kw)

Testing ‘solve’ function with various test data [with arr=[1, 1, 1], expected=1].

Returns:

test_solve_02(**kw)

Testing ‘solve’ function with various test data [with arr=[8, 1, 4], expected=5].

Returns:

test_solve_03(**kw)

Testing ‘solve’ function with various test data [with arr=[7, 4, 10], expected=10].

Returns:

test_solve_04(**kw)

Testing ‘solve’ function with various test data [with arr=[12, 12, 12], expected=18].

Returns:

test_solve_05(**kw)

Testing ‘solve’ function with various test data [with arr=[6, 6, 6], expected=9].

Returns:

test_solve_06(**kw)

Testing ‘solve’ function with various test data [with arr=[1, 23, 2], expected=3].

Returns:

test_solve_07(**kw)

Testing ‘solve’ function with various test data [with arr=[9, 8, 6], expected=11].

Returns:

test_solve_08(**kw)

Testing ‘solve’ function with various test data [with arr=[10, 9, 6], expected=12].

Returns:

test_solve_09(**kw)

Testing ‘solve’ function with various test data [with arr=[4, 4, 3], expected=5].

Returns:

test_solve_10(**kw)

Testing ‘solve’ function with various test data [with arr=[1, 2, 1], expected=2].

Returns:

test_solve_11(**kw)

Testing ‘solve’ function with various test data [with arr=[4, 1, 1], expected=2].

Returns:

test_solve_12(**kw)

Testing ‘solve’ function with various test data [with arr=[8, 2, 8], expected=9].

Returns:

Module contents

Casino chips.