๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.61K 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
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <iostream>
#include <unordered_set>
#include <vector>
using namespace std;
vector<bool> solution(int n, vector<vector<int>>queens, vector<vector<int>>queries) {
    unordered_set<int> a, b, cs, d;
        for (const auto &queen : queens) {
        int r = queen[0], c = queen[1];
        a.insert(r);                
        b.insert(c);               
        cs.insert(r - c);      
        d.insert(r + c);       
    }
    vector<bool> r;
    for (const auto &query : queries) {
        int r_q = query[0], c_q = query[1];
        bool u = (a.count(r_q) > 0 || b.count(c_q) > 0 ||  cs.count(r_q - c_q) > 0 || d.count(r_q + c_q) > 0);
        r.push_back(u);
    }
    return r;
}
๐Ÿ‘3๐Ÿคฎ2
def p(packet):
    bitmask = 0
    for ch in packet:
        bitmask |= (1 << (ord(ch) - ord('a')))
    return bitmask

def ss(packets):
    n = len(packets)
    bitmasks = [p(p) for p in packets]
    lengths = [len(p) for p in packets]
    m = 0
    for i in range(n):
        for j in range(i + 1, n):
            if (bitmasks[i] & bitmasks[j]) == 0:
                m = max(m, lengths[i] * lengths[j])
    return m
num = int(input())
packets = [input() for _ in range(num)]
result = ss(packets)
print(result)


Wipro โœ…
๐Ÿ‘1๐Ÿคฉ1
def ss(cipherCode):
    digits = list(str(abs(cipherCode)))
    digits.sort()
    if digits[0] == '0': 
        for i in range(1, len(digits)):
            if digits[i] != '0':
                digits[0], digits[i] = digits[i], digits[0]
                break
    d = int(''.join(digits))
    if cipherCode < 0:
        d = -d
    print(d)
cipherCode = int(input())
ss(cipherCode)


Wipro โœ…
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