๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.63K subscribers
5.61K photos
3 videos
95 files
10.6K 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
Company โ€“ Manmachine Car Care Pvt. Ltd.
Role โ€“ Data Analyst
Exp. โ€“ Fresher
Apply Here โ€“ https://www.linkedin.com/jobs/view/3974179593

Company โ€“ Agoda
Role โ€“ Business Data Analyst
Exp. โ€“ Fresher
Apply Here โ€“ https://www.linkedin.com/jobs/view/3822845330

Company โ€“ Deutsche Bank
Role โ€“ Data Analyst (ASC), Associate
Exp. โ€“ 0-2 yrs
Apply Here โ€“ https://www.foundit.in/job/data-analyst-asc-associate-deutsche-bank-pune-india-31092016?searchId=c021504c-29f5-4075-9a52-03284b952892

Company โ€“ Genpact
Role โ€“ Associate, Data Analyst
Exp. โ€“ 0-2 yrs
Apply Here โ€“ https://www.foundit.in/job/associate-data-analyst-genpact-bengaluru-bangalore-31103435?searchId=c021504c-29f5-4075-9a52-03284b952892

Company โ€“ Thirumoolar Software
Role โ€“ Machine Learning Engineer
Exp. โ€“ Fresher
Apply Here โ€“ https://www.linkedin.com/jobs/view/3971796148

Company โ€“ Walmart
Role โ€“ Data Scientist III
Exp. โ€“ 0-2 yrs
Apply Here โ€“ https://www.foundit.in/job/data-scientist-iii-walmart-bengaluru-bangalore-india-31110692?searchId=2e1e6619-e60d-4cfd-9341-e0447e6683cc

Company โ€“ Medtronic LABS
Role โ€“ Data Scientist
Exp. โ€“ 0-2 yrs
Apply Here โ€“ https://www.foundit.in/job/data-scientist-medtronic-labs-bengaluru-bangalore-india-31102745?searchId=aed030a2-b8e3-48b1-8844-51dc56871b66

Company โ€“ Wolters Kluwer
Role โ€“ Data Scientist
Exp. โ€“ 0-2 yrs
Apply Here โ€“ https://www.foundit.in/job/data-scientist-wolters-kluwer-pune-india-31183197?searchId=bab7c0ad-85ed-44c7-be8b-8ad18d6330f7

Company โ€“ The Sleep Company
Role โ€“ Data Analytics Intern
Exp. โ€“ Fresher
Apply Here โ€“ https://www.linkedin.com/jobs/view/3975795269
๐Ÿ‘1
#include <bits/stdc++.h>
using namespace std;

struct Results {
    string sn;
    vector<string> c;
};

int rv(const string &cd) {
    unordered_map<string, int> ro = {
        {"2", 2}, {"3", 3}, {"4", 4}, {"5", 5}, {"6", 6}, {"7", 7},
        {"8", 8}, {"9", 9}, {"10", 10}, {"J", 11}, {"Q", 12}, {"K", 13}, {"A", 14}
    };
    string r = cd.substr(0, cd.size() - 1);
    return ro[r];
}

pair<unordered_map<string, vector<string>>, unordered_map<char, vector<string>>>
pc(const vector<string> &cs) {
    unordered_map<string, vector<string>> rd;
    unordered_map<char, vector<string>> sd = {{'S', {}}, {'H', {}}, {'D', {}}, {'C', {}}};
    for (const auto &cd : cs) {
        string r = cd.substr(0, cd.size() - 1);
        char s = cd.back();
        rd[r].push_back(cd);
        sd[s].push_back(cd);
    }
    return {rd, sd};
}

Results f_sc(const vector<string> &cs) {
    auto it = max_element(cs.begin(), cs.end(), [](const string &a, const string &b) {
        return rv(a) < rv(b);
    });
    return {"single card", {*it}};
}

Results f_p(const unordered_map<string, vector<string>> &rd) {
    vector<vector<string>> ps;
    for (const auto &e : rd) {
        if (e.second.size() >= 2) {
            ps.push_back(e.second);
        }
    }
    if (!ps.empty()) {
        auto it = max_element(ps.begin(), ps.end(), [](const vector<string> &a, const vector<string> &b) {
            return rv(a[0]) < rv(b[0]);
        });
        return {"pair", {(*it)[0], (*it)[1]}};
    }
    return {"", {}};
}

Results f_t(const unordered_map<string, vector<string>> &rd) {
    vector<vector<string>> ts;
    for (const auto &e : rd) {
        if (e.second.size() >= 3) {
            ts.push_back(e.second);
        }
    }
    if (!ts.empty()) {
        auto it = max_element(ts.begin(), ts.end(), [](const vector<string> &a, const vector<string> &b) {
            return rv(a[0]) < rv(b[0]);
        });
        return {"triple", {(*it)[0], (*it)[1], (*it)[2]}};
    }
    return {"", {}};
}

Results f_fr(const vector<string> &cs) {
    vector<string> sc = cs;
    sort(sc.begin(), sc.end(), [](const string &a, const string &b) {
        return rv(a) < rv(b);
    });

    unordered_map<int, string> vtcd;
    for (const auto &cd : sc) {
        vtcd[rv(cd)] = cd;
    }

    for (int i = 14; i >= 5; --i) {
        if (vtcd.count(i) && vtcd.count(i - 1) && vtcd.count(i - 2) &&
            vtcd.count(i - 3) && vtcd.count(i - 4)) {
            return {"five in a row", {vtcd[i], vtcd[i - 1], vtcd[i - 2],
                                      vtcd[i - 3], vtcd[i - 4]}};
        }
    }
    return {"", {}};
}

Results f_s(const unordered_map<char, vector<string>> &sd) {
    vector<char> so = {'S', 'H', 'D', 'C'};
    for (char s : so) {
        if (sd.at(s).size() >= 5) {
            return {"suit", vector<string>(sd.at(s).begin(), sd.at(s).begin() + 5)};
        }
    }
    return {"", {}};
}

Results f_tp(const unordered_map<string, vector<string>> &rd) {
    vector<vector<string>> ts;
    vector<vector<string>> ps;
    for (const auto &e : rd) {
        if (e.second.size() >= 3) {
            ts.push_back(e.second);
        } else if (e.second.size() >= 2) {
            ps.push_back(e.second);
        }
    }
    if (!ts.empty() && !ps.empty()) {
        auto ht = max_element(ts.begin(), ts.end(), [](const vector<string> &a, const vector<string> &b) {
            return rv(a[0]) < rv(b[0]);
        });
        auto hp = max_element(ps.begin(), ps.end(), [](const vector<string> &a, const vector<string> &b) {
            return rv(a[0]) < rv(b[0]);
        });
        return {"a triple and a pair", {(*ht)[0], (*ht)[1], (*ht)[2], (*hp)[0], (*hp)[1]}};
    }
    return {"", {}};
}
Results sol(vector<string> &cs) {
    auto pcards = pc(cs);
    auto rd = pcards.first;
    auto sd = pcards.second;
   
    vector<Results> ps = {
        f_sc(cs),
        f_p(rd),
        f_t(rd),
        f_fr(cs),
        f_s(sd),
        f_tp(rd)
    };
   
    ps.erase(remove_if(ps.begin(), ps.end(), [](const Results &r) {
        return r.sn.empty();
    }), ps.end());
   
    unordered_map<string, int> so = {
        {"single card", 1},
        {"pair", 2},
        {"triple", 3},
        {"five in a row", 4},
        {"suit", 5},
        {"a triple and a pair", 6}
    };
   
    auto ss = max_element(ps.begin(), ps.end(), [&so](const Results &a, const Results &b) {
        return so[a.sn] < so[b.sn];
    });
   
    return *ss;
}


//ms task 1 โœ…
def max_units(boxes, units_per_box, truck_size):
    products = list(zip(units_per_box, boxes))
    products.sort(reverse=True)
    max_units = 0
    for units, boxes in products:
        if truck_size >= boxes:
            max_units += units * boxes
            truck_size -= boxes 
        else:
            max_units += units * truck_size
            break
    return max_units

Efficient Shipping โœ…
Affinsys AI Hiring for passionate Software Engineers (0-3 yrs exp)
Share your resume at baldeep@affinsys.com
Office Location : Whitefield Bangalore
Qualification- B.Tech CSE, IT, ECE
Experience Required: 0-3 years

Immediate joiners preferred
If youโ€™re proficient in Python, and excited about implementing cutting-edge solutions, we want you in the team.
string solve(string s) {
    string pre, post;
    deque<char> sDeque(s.begin(), s.end());

    char minChar = *min_element(sDeque.begin(), sDeque.end());

    while (!sDeque.empty()) {

        pre.push_back(sDeque.front());
        sDeque.pop_front();

       
        if (!sDeque.empty() && pre.back() == minChar) {
            minChar = *min_element(sDeque.begin(), sDeque.end());
        }

        while (!pre.empty() && (sDeque.empty() || pre.back() <= minChar)) {
            post.push_back(pre.back());
            pre.pop_back();
        }
    }

    while (!pre.empty()) {
        post.push_back(pre.back());
        pre.pop_back();
    }

    return post;
}

DE Shaw โœ…
๐Ÿ‘3
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
class Dice {
public:
    int t, b, l, r, f, k;

    Dice() {
        t = 1; b = 6; l = 4; r = 3; f = 2; k = 5;
    }

    void rollRight() {
        int temp = t;
        t = l;
        l = b;
        b = r;
        r = temp;
    }

    void rollLeft() {
        int temp = t;
        t = r;
        r = b;
        b = l;
        l = temp;
    }

    void rollDown() {
        int temp = t;
        t = k;
        k = b;
        b = f;
        f = temp;
    }
};

int calculateCubeSum(int R, int C) {
    Dice dice;
    int s = 0;

    for (int i = 0; i < R; ++i) {
        if (i % 2 == 0) {
           
            for (int j = 0; j < C; ++j) {
                s += dice.t;
                if (j < C - 1) dice.rollRight();
            }
        } else {
           
            for (int j = C - 1; j >= 0; --j) {
                s += dice.t;
                if (j > 0) dice.rollLeft();
            }
        }
        if (i < R - 1) dice.rollDown();
    }

    return s;
}

Rolling a Dice โœ…
Goldman Sachs
โค1
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

void displayTheChannel(int N, vector<string>& channels, vector<int>& operations) {
    int i = 0;

    for (auto op : operations) {
        if (op == 1) {
            if (i < N - 1) {
                swap(channels[i], channels[i + 1]);
                i++;
            }
        } else if (op == 2) {
            if (i > 0) {
                swap(channels[i], channels[i - 1]);
                i--;
            }
        } else if (op == 3) {
            if (i < N - 1) {
                swap(channels[i], channels[i + 1]);
                i++;
            }
        }
   
    }

    for (const auto& channel : channels) {
        cout << channel << endl;
    }
}

int main() {
    int N;
    cin >> N; // Number of channels

    vector<string> channels(N);
    for (int i = 0; i < N; ++i) {
        cin >> channels[i];
    }

    int M;
    cin >> M;

    vector<int> operations(M);
    for (int i = 0; i < M; ++i) {
        cin >> operations[i];
    }

    displayTheChannel(N, channels, operations);

    return 0;
}

// CHANNEL SEQUENCE โœ…
๐Ÿ‘1
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <iostream>
#include <vector>
#include <sstream>
#include <unordered_map>

using namespace std;

void generateResult(int N, int M, vector<string>& employeeSalaryAndSuperior, vector<string>& operations) {
    vector<int> salaries(N, 0);
    unordered_map<int, vector<int>> supervisors;

    for (int i = 0; i < N; ++i) {
        stringstream ss(employeeSalaryAndSuperior[i]);
        int salary, supervisor;
        ss >> salary >> supervisor;
        salaries[i] = salary;
        if (supervisor != -1) {
            supervisors[supervisor - 1].push_back(i);
        }
    }

    for (int i = 0; i < M; ++i) {
        stringstream ss(operations[i]);
        char type;
        ss >> type;
        if (type == 'p') {
            int A, X;
            ss >> A >> X;
            A -= 1;
            for (int subordinate : supervisors[A]) {
                salaries[subordinate] += X;
            }
        } else if (type == 'u') {
            int B;
            ss >> B;
            B -= 1;
            cout << salaries[B] << endl;
        }
    }
}

int main() {
    int N, M;
    cin >> N >> M;
    cin.ignore();

    vector<string> employeeSalaryAndSuperior(N);
    for (int i = 0; i < N; ++i) {
        getline(cin, employeeSalaryAndSuperior[i]);
    }

    vector<string> operations(M);
    for (int i = 0; i < M; ++i) {
        getline(cin, operations[i]);
    }

    generateResult(N, M, employeeSalaryAndSuperior, operations);
    return 0;
}

Salary fluctuations โœ…
๐Ÿ‘1