목록고득점kit (4)
눈송이의 개발생활
문제 https://programmers.co.kr/learn/courses/30/lessons/42747 내 코드 def solution(citations): count = 0 citations.sort() for i in range(citations[-1] + 1): new_c = [j for j in range(len(citations)) if citations[j] >= i] if len(new_c) >= i: count = i else: break return count 다른 사람 풀이 def solution(citations): citations = sorted(citations) l = len(citations) for i in range(l): if citations[i] >= l-i: r..
문제 https://programmers.co.kr/learn/courses/30/lessons/42576 내 코드 #1 (실패) def solution(participant, completion): for i in range(len(completion)): if completion[i] in participant: participant.remove(completion[i]) answer = participant[0] if len(participant) != 0 else ' ' return answer 내 코드 #2 (성공) def solution(participant, completion): participant.sort() completion.sort() for p, c in zip(participa..
문제 https://programmers.co.kr/learn/courses/30/lessons/42748 내 코드 def solution(answers): students = [ [1, 2, 3, 4, 5], [2, 1, 2, 3, 2, 4, 2, 5], [3, 3, 1, 1, 2, 2, 4, 4, 5, 5] ] answer = [0, 0, 0] result = [] for i in range(len(answers)): if answers[i] == students[0][i % 5]: answer[0] += 1 if answers[i] == students[1][i % 8]: answer[1] += 1 if answers[i] == students[2][i % 10]: answer[2] += 1 m =..
문제 https://programmers.co.kr/learn/courses/30/lessons/42748 내 코드 def solution(array, commands): answer = [] for index in range(len(commands)): temp = [] i = commands[index][0] - 1 j = commands[index][1] k = commands[index][2] - 1 temp = array[i:j] temp.sort() answer.append(temp[k]) return answer 다른 사람 풀이 def solution(array, commands): answer = [] for command in commands: i,j,k = command answer.a..