๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.6K subscribers
5.59K photos
3 videos
95 files
10.1K 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
We are looking for applied science interns for 2025 in Amazon! If you are a strong candidate pursuing Ph.D. in reinforcement learning and deep learning. Please direct message me with your resume or send it to zhongzhc123@gmail.com! If you're in Seattle this week attending INFORMS annual meeting, let us have a chat!
๐Ÿ‘1
#include <bits/stdc++.h>
using namespace std;

int countPowerNumbers(int l, int r) {
    vector<long long> pows;
    pows.push_back(0);
    pows.push_back(1);

    for (int p = 2; p < 25; p++) {
        long long num = 2;
        while ((long long)(pow(num, p) + 0.5) <= r) {
            pows.push_back((long long)(pow(num, p) + 0.5));
            num++;
        }
    }

    vector<int> ok(r + 1, 0);

    for (int i = 0; i < pows.size(); i++) {
        for (int j = 0; j < pows.size(); j++) {
            if (pows[i] + pows[j] <= r && pows[i] + pows[j] >= l) {
                ok[pows[i] + pows[j]] = 1;
            }
        }
    }

    for (int i = 0; i <= r; i++) {
        ok[i] += ok[i - 1];
    }

    return ok[r] - ok[l - 1];
}


Power Sum โœ…
Thoughtspot
#include <stdio.h>
struct CompanyProfile {
    char company[11];     
    int days_in_operation;
};

const char* oldest(struct CompanyProfile profiles[], int n) {
    int max_days = -1;
    const char* oldest_company = "";
   
    for (int i = 0; i < n; i++) {
        if (profiles[i].days_in_operation > max_days) {
            max_days = profiles[i].days_in_operation;
            oldest_company = profiles[i].company;
        }
    }
   
    return oldest_company;
}
float average_age(struct CompanyProfile profiles[], int n) {
    int total_days = 0;
   
    for (int i = 0; i < n; i++) {
        total_days += profiles[i].days_in_operation;
    }
   
    return (float)total_days / n;
}


Juniper (intern) โœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <stdio.h>
#include <limits.h> 
struct Classroom {
    int n;       
    int grades[103];
};

void maximum(struct Classroom obj) {
    int max_grade = INT_MIN;
    for (int i = 0; i < obj.n; i++) {
        if (obj.grades[i] > max_grade) {
            max_grade = obj.grades[i];
        }
    }
    printf("%d\n", max_grade);
}

void second_maximum(struct Classroom obj) {
    int max_grade = INT_MIN, second_max = INT_MIN;
   
    for (int i = 0; i < obj.n; i++) {
        if (obj.grades[i] >= max_grade) {
            second_max = max_grade;
            max_grade = obj.grades[i];
        } else if (obj.grades[i] > second_max && obj.grades[i] < max_grade) {
            second_max = obj.grades[i];
        }
    }

    if (second_max == INT_MIN) {
        printf("%d\n", max_grade);
    } else {
        printf("%d\n", second_max);
    }
}

void Find_Xor(struct Classroom obj) {
    int xor_result = 0;
    for (int i = 0; i < obj.n; i++) {
        xor_result ^= obj.grades[i];
    }
    printf("%d\n", xor_result);
}


Juniper โœ…
๐Ÿš€ Hiring Freshers

Role: DevOps Intern / Junior DevOps Engineer at ReBid


๐Ÿ” What We're Looking For:
- Strong understanding of AWS โ˜๏ธ
- Linux expertise ๐Ÿง
- Experience with Docker & Kubernetes ๐Ÿณ
- Familiarity with CI/CD pipelines for continuous integration and deployment automation ๐Ÿ”„

โœจBonus Points if you have:
- Hands-on experience with Terraform or other Infrastructure as Code tools
- Knowledge of Ansible for configuration management
Experience

๐Ÿ“ฉ Send your resume to deepak.suhag@rebid.co
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
    ll n;
    cin >> n;
    vector<int> f(7, 0);
    for (ll i = 0; i < n; ++i) {
        int num;
        cin >> num;
        f[num]++;
    }
    ll a =  *min_element(f.begin() + 1, f.end());
    ll b = a * 6;
    ll c = n - b;
    cout << c << endl;
    return 0;
}
#include<bits/stdc++.h>
using namespace std;

int maximumNetworks(int *speed,int n,int minComps,long speedThreshold)
{
long long int count=0,sum=0,b;

for(int i=0;i<n;i++)
{
  sum=sum+speed[i];
   b++;
  if(b>=minComps && sum>=speedThreshold)
  {
   count++;
   sum=0;
   b=0;
   }
  }

  return count;
}


Twilio โœ…
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

bool comparator(pair<int, int>& a, pair<int, int>& b) {
    return (a.first - a.second) > (b.first - b.second);
}

long planProduction(vector<int> worstCase, vector<int> expected) {
    int n = worstCase.size();
    vector<pair<int, int>> products(n);
   
    for (int i = 0; i < n; i++) {
        products[i] = {worstCase[i], expected[i]};
    }
   
    sort(products.begin(), products.end(), comparator);
   
    long startingCash = 0;
    long cashOnHand = 0;
   
    for (int i = 0; i < n; i++) {
        int worst = products[i].first;
        int expect = products[i].second;
       
        if (cashOnHand < worst) {
            startingCash += worst - cashOnHand;
            cashOnHand = worst;
        }
       
        cashOnHand -= expect;
    }
   
    return startingCash;
}


Twilio โœ…
๐Ÿ‘1
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <iostream>
#include <unordered_map>
#include <vector>
#include <string>
using namespace std;
vector<string> rateLimiter(vector<string>& requests, vector<int>& timestamps) {
    unordered_map<string, vector<int>> domainRequests;
    vector<string> result;
   
    for (int i = 0; i < requests.size(); i++) {
        string domain = requests[i];
        int time = timestamps[i];
        vector<int>& reqs = domainRequests[domain]; 
        vector<int> last30;
        for (int t : reqs) {
            if (time - t <= 30) {
                last30.push_back(t);
            }
        }
                vector<int> last5;
        for (int t : last30) {
            if (time - t <= 5) {
                last5.push_back(t);
            }
        }

        if (last5.size() >= 2) {
            result.push_back("{status: 429, message: Too many requests}");
        } else if (last30.size() >= 5) {
            result.push_back("{status: 429, message: Too many requests}");
        } else {
            result.push_back("{status: 200, message: OK}");
            last30.push_back(time);
        }
       
        domainRequests[domain] = last30;
    }
   
    return result;
}


Twilio โœ