We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
def birthday(s, d, m):
# Write your code here
count = 0
if isinstance(s, list):
if m == 0:
return "0"
for i in range(len(s) - m + 1):
if sum(s[i:i + m]) == d:
count += 1
elif isinstance(s, int):
if m == 1 and s == d:
count = 1
return f"{count}"
elif isinstance(s, int):
if m == 1 and s == d:
count = 1
return f"{count}"
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Subarray Division
You are viewing a single comment's thread. Return to all comments →