Skip to content

Commit 7a7cc21

Browse files
Merge pull request #549 from jihye1006/main
[최지혜] 69차 라이브코테 제출
2 parents e3eb46d + 6438a49 commit 7a7cc21

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

live6/test69/문제2/최지혜.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import itertools
2+
3+
n = int(input())
4+
num = list(range(1, n+1))
5+
6+
a = itertools.permutations(num, n) #(1,2,3) 리스트에서 길이가 3인 모든 순열 생성
7+
k = list(a)
8+
9+
for i in k:
10+
p = str(i)
11+
p = p.replace("(","").replace(",","").replace(")","")
12+
print(p)

live6/test69/문제3/최지혜.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from collections import Counter
2+
3+
def solution(want, number, discount):
4+
answer = 0
5+
check = {}
6+
for w, n in zip(want, number):
7+
check[w] = n
8+
9+
for i in range(len(discount)-9):
10+
c = Counter(discount[i:i+10])
11+
if c == check:
12+
answer += 1
13+
14+
return answer

0 commit comments

Comments
 (0)