<jupyter_start><jupyter_text>[Subarray Division](https://www.hackerrank.com/challenges/the-birthday-bar/problem?utm_campaign=challenge-recommendation&utm_medium=email&utm_source=24-hour-campaign&h_r=next-challenge&h_v=zen)<jupyter_code>s= [2,2,1,3,2]
d=4
m=2
# segment finding 
def birthday(s, d, m):
    ways=0
    for k in range(len(s)):
        sum1=[]
        for i in range(k,len(s)):
            sum1.append(s[i])
            if sum(sum1)==d and len(sum1)==m:
                ways +=1
    return ways

birthday(s,d,m)
if<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15827338129496402, 'fraction_numerical': 0.02697841726618705, 'mean_word_length': 3.7606837606837606, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '27168', 'license': 'MIT', 'n_tokens_mistral': 244, 'n_tokens_neox': 227, 'n_words': 32, 'path': 'notebooks/HackerRank_python/Array_2D/subarray_division.ipynb', 'repo_name': 'aj2010adil/HackerRank', 'size': '556'}