Skip to content

Instantly share code, notes, and snippets.

@colinpollock
Created February 12, 2020 03:06
Show Gist options
  • Save colinpollock/f4625b7dff52a32521686db642a3fc34 to your computer and use it in GitHub Desktop.
Save colinpollock/f4625b7dff52a32521686db642a3fc34 to your computer and use it in GitHub Desktop.
a = 'a'
b = 'b'
c = 'c'
d = 'd'
def test_empty():
check([], 0)
def test_all_one():
check([a, a], 1)
check([a, a, a, a], 1)
def test_two_types():
check([a, b], 1)
check([a, b, a, b], 2)
def test_harder():
check([a, a, b, b, c, d], 3)
def check(cookies, expected_num_unique_left):
assert len(cookies) % 2 == 0
assert num_unique_left(cookies) == expected_num_unique_left
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment