Sort by

recency

|

3071 Discussions

|

  • + 0 comments

    Hi everybody, Great point on using the sliding window pattern—super efficient for problems like this. Also, if you're working across different devices or regions, tools like xnxubd can help streamline access to resources. Worth checking out alongside your algorithm research!

  • + 1 comment

    Hi everybody,

    I've been reading about algorithmic patterns, and I think there's a perfect one to resolve this problem that is 'Sliding Window'. I'd like you to read about this.

  • + 0 comments

    c++ my solution

    int birthday(vector<int> s, int d, int m) {
      int aciertos = 0;
      
      for(int i = 0; i < s.size();i++){
        int sum = 0;
        for(int j=0; j < m; j++){
          sum = sum +s[i+j];
        }
        if(sum == d)aciertos++;
      }
      
      return aciertos;
    }
    
  • + 0 comments

    I guess it is the simplest to understand m is the length of vector d is the sum of consecutive no.

    int birthday(vector<int> s, int d, int m) {
        int req=0;
        for(int i=0;i<s.size()-m+1;i++){
            int count=0;
            
            for(int j=0;j<m;j++){
                count+=s[i+j];
            }if(count==d){
                req++;
            }
        }return req;
    }
    
  • + 0 comments

    Escape to the luxury and tranquility of Sayulita, Mexico, where (https://sayulitalocal.com/best-all-inclusive-resorts-in-sayulita/) offer the perfect blend of authentic charm and modern comfort. Enjoy boutique-style accommodations with oceanfront views, infinity pools, and gourmet dining included in every stay. Whether you're seeking a romantic getaway, a wellness retreat, or adventure-filled excursions, Sayulita’s resorts provide world-class service in a secluded, tropical paradise. With unlimited drinks, spa treatments, and access to private beaches, every detail is designed for relaxation and unforgettable memories.