2021/09/16

[폰켓몬]-[찾아라 프로그래밍 마스터] My answer def solution(nums): tmp=set(nums) if(len(nums)/2>=len(tmp)): return len(tmp) else: return len(nums)//2 Another answer def solution(nums): return min(len(set(nums)), len(nums)//2) [체육복]-[탐욕법(Greedy)] My answer def solution(n, lost, reserve): answer = 0 cloth = [1]*n for i in lost: cloth[i-1]-=1 for i in reserve: cloth[i-1]+=1 i=0 while(i!=len(cloth)): if(cloth[i]>1..
창빵맨
'2021/09/16 글 목록