示例#1
0
def has_three_sum(A, t):
    # TODO - you fill in here.
    A.sort()

    for i, num in enumerate(A):
        if two_sum.has_two_sum(A, t-num):
            return True

    return False
示例#2
0
def has_three_sum(A, t):
    A.sort()
    # Finds if the sum of two numbers in A equals to t - a.
    return any(has_two_sum(A, t - a) for a in A)
示例#3
0
def has_three_sum(A, t):

    A.sort()
    # Finds if the sum of two numbers in A equals to t - a.
    return any(has_two_sum(A, t - a) for a in A)
示例#4
0
def has_three_sum(A, t):
    A.sort()
    return any(has_two_sum(A, t - a) for a in A)
示例#5
0
def has_three_sum(A: List[int], t: int) -> bool:

    A.sort()
    # Finds if the sum of two numbers in A equals to t - a.
    return any(has_two_sum(A, t - a) for a in A)
def has_three_sum(A, t):
    for a in A:
        result = has_two_sum(A, t - a)
        if result == True:
            return True
    return False