프로그래머스 문제 풀이 - PCCP 모의고사 #1
⭐️파이썬 알고리즘 스터디 공통 문제⭐️
문제 확인 🏃
[[40, 10, 10], [20, 5, 0], [30, 30, 30], [70, 0, 70], [100, 100, 100]]
>> 210
[[20, 30], [30, 20], [20, 30]]
>> 60
import itertools
def solution(ability):
answer = 0
game = len(ability[0])
npr = list(itertools.permutations(ability, game))
for g in npr:
count = 0
for i in range(game):
count += g[i][i]
answer = max(answer, count)
return answer