예제 #1
0
    def test_not_in_2(self):
        message = [1, 2, 3, 4]
        t = 15

        ans = check_sum(message, t)
        self.assertEqual(ans, [-1, -1])
예제 #2
0
    def test_not_in_singleton(self):
        message = [1]
        t = 5

        ans = check_sum(message, t)
        self.assertEqual(ans, [-1, -1])
예제 #3
0
    def test_whole_seq(self):
        message = [1, 2, 3, 4, 5]
        t = sum(message)

        ans = check_sum(message, t)
        self.assertEqual(ans, [0, 4])
예제 #4
0
    def test_singleton(self):
        message = [1]
        t = 1

        ans = check_sum(message, t)
        self.assertEqual(ans, [0, 0])
예제 #5
0
    def test_single_val(self):
        message = [1, 1, 15, 1]
        t = 15

        ans = check_sum(message, t)
        self.assertEqual(ans, [2, 2])
예제 #6
0
    def test_repeated(self):
        message = [9, 1, 2, 3, 1, 1, 1, 2, 3]
        t = 6

        ans = check_sum(message, t)
        self.assertEqual(ans, [1, 3])
예제 #7
0
    def test_basic(self):
        message = [4, 3, 5, 7, 8]
        t = 12

        ans = check_sum(message, t)
        self.assertEqual(ans, [0, 2])