Skip to content

Commit

Permalink
21
Browse files Browse the repository at this point in the history
  • Loading branch information
greenlemonT committed May 16, 2024
1 parent 53848f6 commit 9617bd1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions MSKIM/21to30/21.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
def solution(want,number,discount):
want_dict={}
for i in range(len(want)):
want_dict[want[i]]=number[i]
answer=0

for i in range(len(discount)-9):
discount_10d={}
for j in range(i,i+10):
if discount[j] in want_dict:
discount_10d[discount[j]]=discount_10d.get(discount[j],0)+1

if discount_10d==want_dict:
answer+=1

return answer

0 comments on commit 9617bd1

Please sign in to comment.