diff --git "a/src/main/kotlin/jimin/49week/\355\225\240\354\235\270 \355\226\211\354\202\254.py" "b/src/main/kotlin/jimin/49week/\355\225\240\354\235\270 \355\226\211\354\202\254.py" new file mode 100644 index 00000000..08576a9c --- /dev/null +++ "b/src/main/kotlin/jimin/49week/\355\225\240\354\235\270 \355\226\211\354\202\254.py" @@ -0,0 +1,28 @@ +from collections import defaultdict + +def solution(want, number, discount): + answer = 0 + + d_info = dict() + w_info = dict() + for product in set(discount): + d_info[product] = 0 + w_info[product] = 0 + + for i in range(10): + d_info[discount[i]] += 1 + + for idx, val in enumerate(want): + w_info[val] = number[idx] + + for i in range(10, len(discount)): + if w_info == d_info: + answer += 1 + + d_info[discount[i - 10]] -= 1 + d_info[discount[i]] += 1 + + if w_info == d_info: + answer += 1 + + return answer \ No newline at end of file