๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.62K subscribers
5.59K photos
3 videos
95 files
10.2K 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
int solution(vector<string> &board)
{
  const size_t n = board.size();
  const size_t m = board[0].size();

  int res = 0;
    // Initialize a prefix sum array to store counts of 'A's and 'B's
    vector<vector<int>> prefixA(n + 1, vector<int>(m + 1, 0));
    vector<vector<int>> prefixB(n + 1, vector<int>(m + 1, 0));

    // Compute the prefix sums for 'A's and 'B's
    for (size_t i = 1; i <= n; ++i) {
        for (size_t j = 1; j <= m; ++j) {
            prefixA[i][j] = prefixA[i - 1][j] + prefixA[i][j - 1] - prefixA[i - 1][j - 1];
            prefixB[i][j] = prefixB[i - 1][j] + prefixB[i][j - 1] - prefixB[i - 1][j - 1];
            if (board[i - 1][j - 1] == 'A') {
                prefixA[i][j]++;
            } else if (board[i - 1][j - 1] == 'B') {
                prefixB[i][j]++;
            }

     if (prefixA[i][j] == prefixB[i][j]) res++;
        }
    }
    return res;
   
}
vector<int> solve(int n, vector<string>& logs) {
    vector<int> eT(n, 0);
    stack<pair<int, int>> fS;

    for (const string& l : logs) {
        stringstream s(l);
        string t;
        vector<string> ts;
        while (getline(s, t, ':')) {
            ts.push_back(t);
        }

        int f = stoi(ts[0]);
        string a = ts[1];
        int tm = stoi(ts[2]);

        if (a == "start") {
            fS.push({f, tm});
        } else {
            int eTm = tm - fS.top().second + 1;
            eT[f] += eTm;
            fS.pop();

            if (!fS.empty()) {
                eT[fS.top().first] -= eTm;
            }
        }
    }

    return eT;
}

Co prime CPU โœ…
long long g[1000001],f[1000001],res=0;
int n,k,m,l,r,c,p;
vector<pair<int,int> > v[1000001 +7];
void upd(int id,int num,long long money)
{
    for(int cin=id;cin<1000001;cin=cin+(cin&-cin))f[cin]+=num,g[cin]+=money;
}
long long get()
{
    int cur=0,tar=k;
    long long res=0;
    for(int cin=19;cin>=0;cin--)
    if(cur+(1<<cin)<1000001&&tar>f[cur+(1<<cin)])
    {
        tar-=f[cur+(1<<cin)];
        res+=g[cur+(1<<cin)];
        cur+=(1<<cin);

    }

    if(tar&&cur<1000001 -1)res+=1LL*(cur+1)*tar;

    return res;
}

int solution(int n, int k, const vector<vector<int>> &plans)
{
  for(int i = 0; i <= n; i++) v[i].clear();
  fill(g, g+n+1, 0);
  fill(f, f+n+1, 0);
  for (const auto &plan : plans) {
    int l = plans[0], r = plans[1], c = plans[2], p = plans[3];
        v[l].push_back(pair<int,int>(c,p));
        v[r+1].push_back(pair<int,int>(-c,p));
  }
  for(int i=1;i<=n;i++)
  {
        int sz=v[i].size();
        for(int j=0;j<sz;j=j+1)upd(v[i][j].second,v[i][j].first,1LL*v[i][j].first*v[i][j].second);
        res+=get();
  }
  return res;
}


IBM โœ…
Role :- Data Engineer
Skills required:- Python, SQL, Spark , AWS , Snowflake
Experience required:- 2 years+
Company:- A Delhi based startup
Salary (11 Lpa+ )

send your resume:-
https://www.linkedin.com/in/mradaltiwari
Exciting Opportunity for Fresh Graduates - Graduate Engineer Trainees (GETs)

We are thrilled to announce an excellent career opportunity for fresh graduates who are passionate about building a rewarding career in steel industry. As we continue to grow and innovate, we are actively seeking talented and ambitious individuals to join our team as Graduate Engineer Trainees (GETs).

Why Join Us:
1. Comprehensive training program
2. Mentorship from industry experts
3. Opportunities for career advancement
4. Dynamic and collaborative work environment

How to Apply:
If you are ready to kick-start your career with a dynamic and forward-thinking organization, fill the form

https://docs.google.com/forms/d/e/1FAIpQLSfWQyLXfPGFb-stCbYiSIPZaCTHh8grXdt_rSfJ0naWpxolKg/viewform