def birthday(s, d, m):
# Write your code here
cnt = 0
for i in range(len(s) - m + 1):
subset = sum(s[i:i + m])
if subset == d:
cnt += 1
return cnt
'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글
[HackerRank-python] Migratory Birds (0) | 2022.07.03 |
---|---|
[HackerRank-python] Divisible Sum Pairs (0) | 2022.07.03 |
[HackerRank-python] Breaking the Records (0) | 2022.07.02 |
[HackerRank-python] Between Two Sets (0) | 2022.07.02 |
[HackerRank-python] Number Line Jumps (0) | 2022.07.01 |