def contains_two_pairs(input_string): num_pairs = 0 from day10 import look_and_say las = look_and_say(input_string) counts = [char for i, char in enumerate(las) if i % 2 == 0] return counts.count("2") >= 2
def test_eight(self): self.assertEqual("312211", look_and_say("111221"))
def test_seven(self): self.assertEqual("111221", look_and_say("1211"))
def test_six(self): self.assertEqual("21", look_and_say("11"))
def test_five(self): self.assertEqual("11", look_and_say("1"))
def test_single_digit(self): input_string = "1" expect = "11" self.assertEqual(expect, day10.look_and_say(input_string))
def test_three_unique_digits(self): input_string = "3333113322" expect = "43212322" self.assertEqual(expect, day10.look_and_say(input_string))
def test_multiple_digits_2(self): input_string = "111221" expect = "312211" self.assertEqual(expect, day10.look_and_say(input_string))
def test_two_different_digits(self): input_string = "21" expect = "1211" self.assertEqual(expect, day10.look_and_say(input_string))
def test_two_consecutive_digits(self): input_string = "11" expect = "21" self.assertEqual(expect, day10.look_and_say(input_string))
def test_look_and_say_1(self): self.assertEqual(list(day10.look_and_say([1])), [1, 1])
def test_look_and_say_111221(self): self.assertEqual(list(day10.look_and_say([1, 1, 1, 2, 2, 1])), [3, 1, 2, 2, 1, 1])
def test_look_and_see(input, expected): assert expected == look_and_say(input)
def test_look_and_say(self): self.assertEqual("11", day10.look_and_say("1")) self.assertEqual("21", day10.look_and_say("11")) self.assertEqual("111221", day10.look_and_say("1211")) self.assertEqual("312211", day10.look_and_say("111221"))