def test_get_combinations_3(self): combinations = get_combinations({0, 1, 2}) self.assertEqual(6, len(combinations)) self.assertIn([0, 1, 2], combinations) self.assertIn([0, 2, 1], combinations) self.assertIn([1, 0, 2], combinations) self.assertIn([1, 2, 0], combinations) self.assertIn([2, 0, 1], combinations) self.assertIn([2, 1, 0], combinations)
def run_amps(program: []): combinations = get_combinations({5, 6, 7, 8, 9}) max_out = -1000 max_comb = [] for combination in combinations: o = check_combination(program, combination) if o > max_out: max_out = o max_comb = combination print("Maximum output: ", max_out, "comb:", max_comb)
def test_get_combinations_1(self): combinations = get_combinations({0}) self.assertEqual(1, len(combinations)) self.assertSequenceEqual([0], combinations[0])
def test_get_combinations_5(self): combinations = get_combinations({0, 1, 2, 3, 4}) self.assertEqual(1 * 2 * 3 * 4 * 5, len(combinations))
def test_get_combinations_2(self): combinations = get_combinations({0, 1}) self.assertEqual(2, len(combinations)) self.assertIn([0, 1], combinations) self.assertIn([1, 0], combinations)