알고리즘

[프로그래머스] 삼총사

HHB 2023. 10. 9. 19:16
def solution(number):
    answer = 0
    for i in range(len(number)):
        for j in range(i+1, len(number)):
            for n in range(j+1, len(number)):
                if number[i] + number[j] + number[n] == 0:
                    answer += 1
    return answer
728x90
반응형
LIST