Sort by

recency

|

3083 Discussions

|

  • + 0 comments

    my solution in rust:

    fn birthday(s: &[i32], d: i32, m: i32) -> i32 {
        s.windows(m as usize)
            .filter(|&window| window.iter().sum::<i32>() == d)
            .count() as i32
    }
    
  • + 0 comments

    Visit our platform for Quran learning and Islamic education: Zeenat ul Quran

  • + 0 comments

    Visit our platform for Quran learning and Islamic education: Zeenat ul Quran

  • + 0 comments

    Nice and simple implementation! This reminds me of the "birthday chocolate" problem — checking if a subarray of length m adds up to d. It's always fun seeing how people approach these problems differently.

    Also, if anyone's into peaceful learning environments outside of coding, I’ve been working on a site where I explore Quranic guidance. If you’re curious, feel free to search “Zeenat ul Quran” online — it’s helped a lot of people in different ways. 😊

  • + 0 comments

    my C solution:

    int birthday(int s_count, int* s, int d, int m) {
        int outp = 0;
        for(int i = 0; i < s_count; i++){
            int day = d;
            int month = m;
            int value = i;
            while(month--){
                day -= s[value];
                value++;
            }
            if(day == 0){
                outp++;
            }
        }
        return outp;
    }