[pro] 체육대회

letsbebrave·2023년 8월 6일
0

codingtest

목록 보기
142/146

문제 링크

https://school.programmers.co.kr/learn/courses/15008/lessons/121684

풀이

from itertools import permutations

def solution(ability):
    answer = 0
    arr = list(permutations(ability, len(ability[0])))
    
    for i in range(len(arr)):
        total = 0
        for j in range(len(ability[0])):
            total += arr[i][j][j]
        answer = max(answer, total)
    
    return answer
profile
그게, 할 수 있다고 믿어야 해

0개의 댓글