๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
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
void solve(vector<ll> a,ll l ,ll r){
   set<pair<ll,ll>>s;
   map<ll,ll>m;
   ll i=0;
   ll ans=INT_MAX;
   for(auto x:a){
      
       if(x<l || x>r){
           i++;
           continue;
       }
       else{
           if(m.find(x)==m.end()){
               m[x]=i;
               s.insert({i,x});
           }
           else{
               s.erase({m[x],x});
               s.insert({i,x});
               m[x]=i;
           }
       }
       //cout<<i<<" "<<m.size()<<endl;
       if(m.size()==r-l+1){
           auto it=s.begin();
         
           ans=min(ans,i-(*s.begin()).first+1);
       }
       i++;
   }
   cout<<(ans==INT_MAX?-1:ans)<<endl;
}

Tradedesk โœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
def getMaximumLength(lotteryID, winnerID, k):
    m, n = len(lotteryID), len(winnerID)

    dp = [[[0] * n for _ in range(m)] for _ in range(k + 1)]

    for o in range(k + 1):
        for i in range(m):
            for j in range(n):
                c1, c2 = lotteryID[i], winnerID[j]
                abs_diff = abs(ord(c1) - ord(c2))
                diff = (26 - abs_diff if abs_diff > 13 else abs_diff)
               
                if o > 0:
                    dp[o][i][j] = max(dp[o][i][j], dp[o - 1][i][j])
                if i > 0:
                    dp[o][i][j] = max(dp[o][i][j], dp[o][i - 1][j])
                if j > 0:
                    dp[o][i][j] = max(dp[o][i][j], dp[o][i][j - 1])
                if o - diff >= 0:
                    if i > 0 and j > 0:
                        dp[o][i][j] = max(dp[o][i][j], dp[o - diff][i - 1][j - 1] + 1)
                    else:
                        dp[o][i][j] = 1 # if i or j==0 and it is possible to use a move then string can only match 1 char

    return dp[k][m - 1][n - 1]

Source : Winner โœ…
vector<int> getNetProfit(vector<string> e) {
    unordered_map<string, int> p;
    unordered_map<string, int> q;
    vector<int> r;
    int b = 0;

    for (const auto& v : e) {
        istringstream i(v);
        string a, s;
        int x;
        i >> a >> s >> x;

        if (a == "BUY") {
            b -= p[s] * x;
            q[s] += x;
        } else if (a == "SELL") {
            b += p[s] * x;
            q[s] -= x;
        } else if (a == "CHANGE") {
            b += q[s] * x;
            p[s] += x;
        } else if (a == "QUERY") {
            r.push_back(b);
        }
    }

    return r;
}

Source : Hola โœ…
bool isMatch(string& text, string& pat) {
    int textLen = text.length();
    int patLen = pat.length();

    if (patLen != textLen) {
        return false;
    }

    for (int i = 0; i < textLen; ++i) {
        if (pat[i] != '*' && pat[i] != text[i]) {
            return false;
        }
    }

    return true;
}

vector<string> matchStrings(vector<string> text, vector<string> pat) {
    vector<string> result;

    for (int i = 0; i < text.size(); ++i) {
        if (isMatch(text[i], pat[i])) {
            result.push_back("YES");
        } else {
            result.push_back("NO");
        }
    }

    return result;
}

//Amazon Qs 1โœ…
int solve(vector<int> a, vector<int> b) {
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());

    int c = 0;
    for (int i = 0; i < a.size(); i++) {
        c += abs(a[i] - b[i]);
    }

    return c;
}

Amazon โœ…
def findMinimumOperations(boxes):
    total_boxes = sum(boxes)
    average_boxes = total_boxes // len(boxes)

    extra_piles = total_boxes % len(boxes)

    operations = 0

    for box_count in boxes:
        difference = box_count - average_boxes

        if difference > 0:
            operations += difference
           
            if extra_piles > 0:
                operations -= 1
                extra_piles -= 1

    return operations

Amazon โœ…
#include<bits/stdc++.h>
using namespace std;

bool check(vector<int>& v) {
    for(int i = 1; i < v.size(); i++) {
        if(v[i] % 2 == v[i-1] % 2) return false;
    }
    return true;
}

void solve(int n) {
    vector<int> v(n);
    iota(v.begin(), v.end(), 1);
    do {
        if(check(v)) {
            for(int i = 0; i < n; i++) {
                cout << v[i] << " ";
            }
            cout << "\n";
        }
    } while(next_permutation(v.begin(), v.end()));
}

int main() {
    int n;
    cin >> n;
    solve(n);
    return 0;
}

Meesho โœ…
JOB OPENING UPDATE

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

Company โ€“ MobileWorld Vadodara
Role โ€“ Data Analyst
Exp. โ€“ Fresher or 2yrs
Apply Here โ€“ https://www.simplyhired.co.in/job/v2EOhk9tHARNM976W87UDNj2NssxTDuVy4UnYtenuzJ_w2NXNEdLDA

Company โ€“ Virtusa
Role โ€“ Data Engineer
Exp. โ€“ Fresher
Apply Here โ€“ https://www.linkedin.com/jobs/view/3807584624

Company โ€“ Bureau
Role โ€“ Data Engineering Intern
Exp. โ€“ Fresher
Apply Here โ€“ https://www.linkedin.com/jobs/view/3807286769

Company โ€“ MedTourEasy
Role โ€“ Data Analysis Trainee
Exp. โ€“ Fresher
Apply Here โ€“ https://www.linkedin.com/jobs/view/3808140227

Company โ€“ Energy Alternatives India
Role โ€“ AI For Climate Research
Exp. โ€“ Fresher
Apply Here โ€“ https://internshala.com/internship/detail/ai-for-climate-research-internship-in-chennai-at-energy-alternatives-india1705387859?utm_source=cp_link&referral=web_share

Company โ€“ Faclon
Role โ€“ Data Science Intern
Exp. โ€“Fresher
Apply Here โ€“ https://internshala.com/internship/detail/data-science-internship-in-mumbai-at-faclon1705298889?utm_source=cp_link&referral=web_share

Company โ€“ Binford Research Labs pvt ltd
Role โ€“ Artificial Intelligence
Exp. โ€“ Fresher
Apply Here โ€“ https://www.simplyhired.co.in/job/rWGTWDvTRKMxe6aIlevL06tZYOHLxlzInjBkq4DPUmZtUpE2LE1JCA
Amazon India Hiring

Amazon Web Services - AWS is hiring for Cloud Support Associate (CSA). As a CSA, you'll solve customer cases using advanced troubleshooting techniques, providing tailored solutions and driving customer interactions.

Permanent WFH - Work From Home. Good Work Life Balance. Good pay.

What qualifications/skills are we looking for?
- Bachelorโ€™s Degree in Engineering or MCA - 2023 Graduates ONLY
- 0-1 years of experience in Linux/Windows Systems administration OR Database design and Optimization OR BigData Analysis OR Network administration OR Dev-ops. (no relevant experience also works but would be a plus)

Job link - https://amazon.jobs/en/jobs/2469306/cloud-support-associate

P.S. - You would be tested on your Computer Networking & Operating Systems concept (the college subjects, yes). So, if you are proficient with the same. It would be a cake walk to clear the interviews.