๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.52K subscribers
5.56K photos
3 videos
95 files
9.7K 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
long long solve(int n, int** A) {
    vector<pair<int, int>> vp;
    vp.push_back({-1, 0});

    for (int i = 0; i < n; i += 1) {
        vp.push_back({A[i][1], A[i][2]});
    }

    sort(vp.begin(), vp.end());

    auto check = [&] (int mid) {
        long long dishes = 0;

        for (int i = 1; i <= n; i += 1) {
            dishes += static_cast<long long>(vp[i].first - vp[i - 1].first) * mid;
            if (vp[i].second > dishes)
                return false;
            else
                dishes -= vp[i].second;
        }

        return true;
    };

    int l = 0, r = 1e9;

    while (r - l > 1) {
        int mid = (l + r) / 2;
        if (!check(mid))
            l = mid;
        else
            r = mid;
    }

    return r;
}

Chef and ordering โœ…
def Solve(N, K):
    slots = [0] * K
    current_bag = 1
    current_slot = 0

    while N > 0:
        bags_to_distribute = min(N, current_bag)
        slots[current_slot] += bags_to_distribute
        N -= bags_to_distribute
        current_bag += 1
        current_slot = (current_slot + 1) % K

    return slots

N = int(input())
K = int(input())

result = Solve(N, K)
print(" ".join(map(str, result)))

Airport Baggage โœ…
bool check(string s, string t, vector<int>& order, int mid) {
    int n = s.size(), m = t.size();
    vector<int> pos(n);
    for (int i = 0; i < mid; ++i) {
        pos[order[i] - 1] = -1;
    }
    for (int i = mid; i < n; ++i) {
        pos[order[i] - 1] = i;
    }
    int j = 0;
    for (int i = 0; i < n && j < m; ++i) {
        if (pos[i] != -1 && s[i] == t[j]) {
            ++j;
        }
    }
    return j == m;
}

int solve(string s, string t, vector<int>& order) {
    int low = 0, high = s.size();
    while (low < high) {
        int mid = low + (high - low + 1) / 2;
        if (check(s, t, order, mid)) {
            low = mid;
        } else {
            high = mid - 1;
        }
    }
    return low;
}

String Search โœ…
๐ŸšจJOB OPENING UPDATE๐Ÿšจ

Company โ€“ S&P Global
Role โ€“ Data Quality Analyst
Exp. โ€“ Fresher
Apply Here โ€“ https://careers.spglobal.com/jobs/295211?lang=en-us&utm_source=indeed&utm_source=indeed

Company โ€“ Shell
Role โ€“ Lead BI Analyst โ€“ Data Engineering
Exp. โ€“ Fresher
Apply Here โ€“ https://jobs.shell.com/job/bengaluru/lead-bi-analyst-data-engineering/25244/59453151280?codes=1-INDEED

Company โ€“ Ericsson
Role โ€“ Data Engineer
Exp. โ€“ Fresher
Apply Here โ€“ https://jobs.ericsson.com/careers/job/563121757378324?domain=ericsson.com&jobPipeline=Indeed

Company โ€“ FXCM
Role โ€“ Business Intelligence Analyst
Exp. โ€“ Fresher
Apply Here โ€“ https://fxcm-hr.my.salesforce-sites.com/recruit/fRecruit__ApplyJob?vacancyNo=VN982&sid=37


Company โ€“ Cheeron Life
Role โ€“ Data Analyst Trainee
Exp. โ€“ 0-1 yrs
Apply Here โ€“ https://www.naukri.com/job-listings-data-analyst-trainee-cheeron-life-surat-gujarat-0-to-1-years-121023010939?src=jobsearchDesk&sid=17043459554449609&xp=1&px=1&nignbevent_src=jobsearchDeskGNB

Company โ€“ Zcts
Role โ€“ Data Analyst Trainee
Exp. โ€“ 0-1 yrs
Apply Here โ€“ https://www.naukri.com/job-listings-data-analyst-trainee-da-trainee-zcts-coimbatore-0-to-1-years-301223903794?src=jobsearchDesk&sid=17043459554449609&xp=2&px=1&nignbevent_src=jobsearchDeskGNB

Company โ€“ Comcast Corporation
Role โ€“ Machine Learning Intern
Exp. โ€“ 0-2 yrs
Apply Here โ€“ https://jobs.comcast.com/jobs/description/regular?external_or_internal=External&job_id=R364614&source=ind_orga_at&jobPipeline=Indeed

Company โ€“ SatSure Analytics India
Role โ€“ Data Scientist Intern
Exp. โ€“ Fresher
Apply Here โ€“ https://satsure.keka.com/careers/jobdetails/26859

Company โ€“ Add Innovations Private Limited
Role โ€“ Deep Learning Intern
Exp. โ€“ Fresher
Apply Here โ€“ https://smartapply.indeed.com/beta/indeedapply/form/contact-info

ALL THE BEST๐Ÿ’™
#include <iostream>
#include <bits/stdc++.h>
using namespace std;

unordered_map<int, vector<int>> g;

void create(vector<int>& p) {
    for (int i = 1; i < p.size(); i++) {
        g[p[i]].push_back(i);
    }
}

int dfs(int s, vector<int>& w, int oH, int uH, int a, vector<int>& v) {
    if (g.find(s) == g.end()) {
        if (w[s] == a) {
            v[s] = oH;
            return oH;
        }
        return 0;
    }

    int p = 0;
    if (w[s] == a) {
        p = oH;
    }
    for (int t : g[s]) {
        p += dfs(t, w, oH, uH, a, v);
    }
    v[s] = p;
    return p;
}

void solve(vector<int>& p, vector<int>& w, int oH, int uH) {
    g.clear();

    vector<int> h(w.size(), 0);
    vector<int> u(w.size(), 0);

    create(p);
    dfs(0, w, oH, uH, 1, h);
    dfs(0, w, uH, oH, -1, u);

    int ans = INT_MAX;
    int pen = u[0];
    for (int i = 0; i < w.size(); i++) {
        ans = min(ans, h[i] + (pen - u[i]));
    }
    cout << ans << endl;
}

Hydrate the nodes โœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <iostream>
#include <vector>
#include <unordered_map>

class Main {
public:
    static long getZeroBitSubarrays(const std::vector<int>& arr) {
        int n = arr.size();
        long totalSubarrayCount = static_cast<long>(n) * (n + 1) / 2;
        long nonzeroSubarrayCount = 0;
        std::unordered_map<int, int> windowBitCounts;
        int leftIdx = 0;

        for (int rightIdx = 0; rightIdx < n; rightIdx++) {
            int rightElement = arr[rightIdx];

            if (rightElement == 0) {
                windowBitCounts.clear();
                leftIdx = rightIdx + 1;
                continue;
            }

            std::vector<int> setBitIndices = getSetBitIndices(rightElement);
            for (int index : setBitIndices) {
                windowBitCounts[index]++;
            }

            while (leftIdx < rightIdx && isBitwiseAndZero(rightIdx - leftIdx + 1, windowBitCounts)) {
                for (int index : getSetBitIndices(arr[leftIdx])) {
                    windowBitCounts[index]--;
                    if (windowBitCounts[index] == 0) {
                        windowBitCounts.erase(index);
                    }
                }
                leftIdx++;
            }

            nonzeroSubarrayCount += (rightIdx - leftIdx + 1);
        }

        return totalSubarrayCount - nonzeroSubarrayCount;
    }

private:
    static std::vector<int> getSetBitIndices(int x) {
        std::vector<int> setBits;
        int pow2 = 1;
        int exponent = 0;

        while (pow2 <= x) {
            if ((pow2 & x) != 0) {
                setBits.push_back(exponent);
            }

            exponent++;
            pow2 *= 2;
        }

        return setBits;
    }

    static bool isBitwiseAndZero(int windowLength, const std::unordered_map<int, int>& bitCounts) {
        for (const auto& entry : bitCounts) {
            if (entry.second >= windowLength) {
                return false;
            }
        }
        return true;
    }
};

DE Shaw โœ…
C++
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <bits/stdc++.h>
using namespace std;

int solve(vector<vector<int>>& s, vector<vector<int>>& t) {
    int n = s.size();

    auto h = [](const vector<vector<int>>& i) -> size_t {
        size_t v = 0;
        for (const auto& r : i) {
            for (int p : r) {
                v = v * 2 + p;
            }
        }
        return v;
    };

    auto is = [](const vector<vector<int>>& a, const vector<vector<int>>& b) -> bool {
        return a == b;
    };

    queue<pair<vector<vector<int>>, int>> q;
    unordered_set<size_t> v;

    q.push({s, 0});
    v.insert(h(s));

    while (!q.empty()) {
        auto [c, fl] = q.front();
        q.pop();

        if (is(c, t)) {
            return fl;
        }

        for (int i = 0; i < n; ++i) {
           
            vector<vector<int>> nr = c;
            for (int j = 0; j < n; ++j) {
                nr[i][j] = 1 - nr[i][j];
            }
            size_t rh = h(nr);
            if (v.find(rh) == v.end()) {
                q.push({nr, fl + 1});
                v.insert(rh);
            }

           
            vector<vector<int>> nc = c;
            for (int j = 0; j < n; ++j) {
                nc[j][i] = 1 - nc[j][i];
            }
            size_t ch = h(nc);
            if (v.find(ch) == v.end()) {
                q.push({nc, fl + 1});
                v.insert(ch);
            }
        }
    }

    return -1;
}

DE Shawโœ…
#include<bits/stdc++.h>
using namespace std;
class hm {
    unordered_map<int, int> m;
    int k = 0, v = 0;

public:
    void i(int x, int y) {
        x -= k;
        y -= v;
        m[x] = y;
    }

    int g(int x) {
        x -= k;
        if (m.find(x) == m.end()) {
            return -1;
        }
        return m[x] + v;
    }

    void ak(int x) {
        k += x;
    }

    void av(int y) {
        v += y;
    }
};

int solve(vector<string>& qt, vector<vector<int>>& q) {
    hm h;
    int s = 0;
    for (int i = 0; i < qt.size(); ++i) {
        if (qt[i] == "insert") {
            h.i(q[i][0], q[i][1]);
        } else if (qt[i] == "addToKey") {
            h.ak(q[i][0]);
        } else if (qt[i] == "addToValue") {
            h.av(q[i][0]);
        } else if (qt[i] == "get") {
            int v = h.g(q[i][0]);
            if (v != -1) {
                s += v;
            }
        }
    }
    return s;
}
GeeksforGeeks is hiring For Technical Content Writer Intern. โœ๏ธ

What we are looking for:
- Available for 6 months in-office internship
- Having SEO Knowledge
- Creative Content
- Experience preferred

Location:- Noida

Join the Geeksforgeeks family and be part of something extraordinary! ๐Ÿ“š Fill The Forms Given Below To Apply ๐Ÿ‘‡

https://lnkd.in/gZha5wWf