def test_with_santiagos_solutions(self): """ These solutions were given by Santiago at https://blog.svpino.com/2015/05/08/solution-to-problem-5-and-some-other-thoughts-about-this-type-of-questions """ u = [ '+1 +2 +3 -4 +5 +6 +78 +9', '+1 +2 +34 -5 +67 -8 +9', '+1 +23 -4 +5 +6 +78 -9', '+1 +23 -4 +56 +7 +8 +9', '+12 +3 +4 +5 -6 -7 +89', '+12 +3 -4 +5 +67 +8 +9', '+12 -3 -4 +5 -6 +7 +89', '+123 +4 -5 +67 -89', '+123 +45 -67 +8 -9', '+123 -4 -5 -6 -7 +8 -9', '+123 -45 -67 +89' ] v = Question_5.all_possibilities_that_sum_to_100() self.assertSetEqual(set(u), set(v))
def test_with_example_sequence(self): u = Question_5.all_possibilities_that_sum_to_100() self.assertIn('+1 +2 +34 -5 +67 -8 +9', u)