?!!!! ????? !?!?!? !!!!? ????? ?!!!! ??!!! ????! ??!!! ??!!?? !!??? !!!!! !?!?!? ?!!!! ???!! !!!!? ????? !!!?? ????!
exec("import base64;exec(base64.b64decode('ZnJvbSByYW5kb20gaW1wb3J0IHJhbmRpbnQgYXMgbzsKZGVmIGFkZGl0aW9uKGEsIGIpOgoJdD1hK2I7YT1baSBmb3IgaSBpbiBzdHIoYSldO2I9W2kgZm9yIGkgaW4gc3RyKGIpXTthPVsoeCx5KSBmb3IgeCBpbiBhIGZvciB5IGluIGJdO2E9e2I6W2ludChiWzBdKStpbnQoYlsxXSldIGZvciBiIGluIGF9O2I9W3hbMF0gZm9yIHggaW4gYS52YWx1ZXMoKV07YT1zdW0oYikKCXdoaWxlIGEhPXQ6CgkJaWYgYTx0OmIsYT1zKHQsYixhKQoJcmV0dXJuIGEKZGVmIHModCxhLGIpOgoJd2hpbGUgYjx0OmEuYXBwZW5kKG8oMSwxKSk7Yj1zdW0oYSk7cmV0dXJuIGEsYg=='.encode('ascii')))")
def addition(a, b):num_of_ones = []for n in range(a):num_of_ones.append(1)for n in range(b):num_of_ones.append(1)return len(num_of_ones)- exec("import base64;exec(base64.b64decode('ZnJvbSByYW5kb20gaW1wb3J0IHJhbmRpbnQgYXMgbzsKZGVmIGFkZGl0aW9uKGEsIGIpOgoJdD1hK2I7YT1baSBmb3IgaSBpbiBzdHIoYSldO2I9W2kgZm9yIGkgaW4gc3RyKGIpXTthPVsoeCx5KSBmb3IgeCBpbiBhIGZvciB5IGluIGJdO2E9e2I6W2ludChiWzBdKStpbnQoYlsxXSldIGZvciBiIGluIGF9O2I9W3hbMF0gZm9yIHggaW4gYS52YWx1ZXMoKV07YT1zdW0oYikKCXdoaWxlIGEhPXQ6CgkJaWYgYTx0OmIsYT1zKHQsYixhKQoJcmV0dXJuIGEKZGVmIHModCxhLGIpOgoJd2hpbGUgYjx0OmEuYXBwZW5kKG8oMSwxKSk7Yj1zdW0oYSk7cmV0dXJuIGEsYg=='.encode('ascii')))")
import codewars_test as test from solution import addition import random # test.assert_equals(actual, expected, [optional] message) @test.describe("Example") def test_group(): @test.it("test case") def test_case(): for i in range(100): n1, n2 = random.randint(1, 100), random.randint(1, 100) test.assert_equals(addition(n1, n2), sum([n1, n2]))
- import codewars_test as test
- from solution import addition
- import random
- # test.assert_equals(actual, expected, [optional] message)
- @test.describe("Example")
- def test_group():
- @test.it("test case")
- def test_case():
n = random.randint(1, 100)- for i in range(100):
n1, n2 = n, n- n1, n2 = random.randint(1, 100), random.randint(1, 100)
- test.assert_equals(addition(n1, n2), sum([n1, n2]))