We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc711df commit 8f31bcaCopy full SHA for 8f31bca
week17/JeongMin/메뉴 리뉴얼.py
@@ -0,0 +1,19 @@
1
+from collections import defaultdict
2
+from itertools import combinations
3
+
4
+def solution(orders, course):
5
+ answer=[]
6
7
+ for c in course:
8
+ dic=defaultdict(int)
9
+ for o in orders:
10
+ for com in list(combinations(sorted(o), c)):
11
+ dic[com]+=1
12
13
+ if dic:
14
+ m=max(dic.values())
15
+ for k, v in dic.items():
16
+ if v==m and v>=2:
17
+ answer.append(''.join(k))
18
19
+ return sorted(answer)
week17/JeongMin/짝지어 제거하기.py
@@ -0,0 +1,18 @@
+s='cdcd'
+from collections import deque
+stack=deque()
+for ss in s:
+ stack.append(ss)
+ if len(stack)>=2 and stack[-1]==stack[-2]:
+ stack.pop()
+if not stack:
+ print(1)
+else:
+ print(0)
0 commit comments