๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.57K subscribers
5.59K photos
3 videos
95 files
10K links
๐ŸšฉMain Group - @SuperExams
๐Ÿ“Job Updates - @FresherEarth

๐Ÿ”ฐAuthentic Coding Solutions(with Outputs)
โš ๏ธDaily Job Updates
โš ๏ธHackathon Updates & Solutions

Buy ads: https://telega.io/c/cs_algo
Download Telegram
#include <iostream>
#include<bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin>>n;
    vector<int>arr(n);
    for(int i=0;i<n;i++)
    cin>>arr[i];
    int x;
    int y;
    cin>>x>>y;
    int ans=INT_MAX;
    for(int i=0;i<y;i++)
    {
        if(i+(x-1)*y<n)
        {
            int low=i;
            int high=i;
            int curr=0;
            int count=x;
            while(high<n and count>0)
            {
                curr+=arr[high];
                high+=y;
                count--;
            }
            // cout<<curr<<endl;
            ans=min(ans,curr);
            while(high<n)
            {
                curr+=arr[high];
                curr-=arr[low];
                low+=y;
                high+=y;
                ans=min(ans,curr);
            }
        }
    }
    cout<<ans;
    return 0;
}
public static int numPaths(List<List<Integer>> warehouse) {
    int r = warehouse.size(), c = warehouse.get(0).size();
    int[][] paths = new int[r][c];
   
    if (warehouse.get(0).get(0) == 1)
        paths[0][0] = 1;
   
    for (int i = 1; i < r; i++) {
        if (warehouse.get(i).get(0) == 1)
            paths[i][0] = paths[i - 1][0];
    }
   
    for (int j = 1; j < c; j++) {
        if (warehouse.get(0).get(j) == 1)
            paths[0][j] = paths[0][j - 1];
    }
   
    for (int i = 1; i < r; i++) {
        for (int j = 1; j < c; j++) {
            if (warehouse.get(i).get(j) == 1)
                paths[i][j] = paths[i - 1][j] + paths[i][j - 1];
        }
    }
   
    return paths[r - 1][c - 1];
}

Paths in warehouse โœ…
๐Ÿ‘2
Magicpin hiring Interns across product, analytics and strategy and ops. This opportunity is for all college students to work remotely along with their colleges.

What we are looking for:
๏ปฟ๏ปฟGood analytical and problem solving skills
๏ปฟ๏ปฟHigh ownership
๏ปฟ๏ปฟAbility to learn quickly

If you are interested, please drop me an email on arshdeep.gulati@magicpin.in
Ivykids (formerly Yellow Class) hiring a Mernstack developer to join our tech team!

PS - 2023 B.tech batch students are most welcome!

Location - Work from office, Gurgaon.

Interested candidates can share their updated CV at deepanshi@ivypods.com to proceed ahead with the selection process.
int helper(string a,string b){
    int i,j,n=a.size();
    if(n!=b.size())return -1;
    int ans=0,cnt=0;
    for(i=0;i<n;i++){
        if(a[i]==b[i] && a[i]!='?')return -1;
        if(a[i]=='?' && b[i]=='?'){
            cnt++;
            continue;
        }
        if(b[i]=='?'){
            if(a[i]=='W')b[i]='R';
            if(a[i]=='R')b[i]='W';
            ans++;
        }
        if(a[i]=='?'){
            if(b[i]=='W')a[i]='R';
            if(b[i]=='R')a[i]='W';
            ans++;
        }
    }
    int w=0,r=0;
    for(i=0;i<n;i++){
        if(a[i]=='W')w++;
        else if(a[i]=='R')r++;
    }
    int x=abs(w-r);
    // cout<<x<<" "<<cnt<<endl;
    if(x<=cnt)ans+=(2*x);
    else return -1;
    return ans;
}

American Express (Balance the Board)