๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
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
๐ŸšจJOB OPENING ALERT๐Ÿšจ

Company โ€“ Cerina Health
Role โ€“ AI ML Engineer - Intern
Exp. โ€“ Fresher
Apply Here โ€“ https://www.linkedin.com/jobs/view/3902420120

Company โ€“ NextGen Technologies
Role โ€“ Data Scientist
Exp. โ€“ Fresher
Apply Here โ€“ https://www.linkedin.com/jobs/view/3903571754

Company โ€“ Express Analytics India Pvt Ltd
Role โ€“ Data Science Internship
Exp. โ€“ Fresher
Apply Here โ€“ https://internshala.com/internship/details/work-from-home-data-science-internship-at-express-analytics-india-pvt-ltd1713511795?utm_source=cp_link&referral=web_share

Company โ€“ DEPLOYH.AI Technologies
Role โ€“ Data Engineer Intern
Exp. โ€“ 0-1 yr
Apply Here โ€“ https://www.naukri.com/job-listings-data-engineer-intern-deployh-ai-technologies-private-limited-hyderabad-0-to-1-years-160424012587?src=jobsearchDesk&sid=17135123840742782_3&xp=1&px=1&nignbevent_src=jobsearchDeskGNB
๐Ÿ‘2
#include<bits/stdc++.h>
#define ll long long
using namespace std;
vector<vector<ll>>adj[10000006];
ll solve(ll n)
{
    vector<ll>vis(n,0);
    priority_queue<pair<ll,ll>,vector<pair<ll,ll>>,greater<pair<ll,ll>>>pq;
    vector<ll>dist(n,1e9);
    dist[0]=0;
    pq.push({0,0});
    vis[0]=1;
    while(!pq.empty()){
        ll dis=pq.top().first;
        ll node=pq.top().second;
        vis[node]=1;
        pq.pop();
        for(auto it:adj[node]){
            ll edw=it[1];
            ll adjNode=it[0];
            if(dis+edw<dist[adjNode]){
                dist[adjNode]=dis+edw;
                pq.push({dist[adjNode],adjNode});
            }
        }
    }
    ll res=dist[0];
    for(ll i=0;i<n;i++)
    {
        res=max(res,dist[i]);
        if(!vis[i])return -1;
    }
    return res;
}
signed main()
{
    ll n,m; cin>>n>>m;
    for(ll i=0;i<m;i++)
    {
       ll a,b,c; cin>>a>>b>>c;
       a--;
       b--;
       adj[a].push_back({b,c});
    }
    cout<<solve(n);
    return 0;
}


Network delay Time โœ…
#include <iostream>
#include <vector>
#include <stack>

using namespace std;

vector<int>solve(vector<int>& arr) {
    vector<int>result;
    stack<int>s;
    for (int i=0;i<arr.size();i++)
    {
        while (!s.empty() && s.top() >= arr[i]) s.pop();
        if (s.empty()) result.push_back(-1);
        else result.push_back(s.top());
        s.push(arr[i]);
    }
    return result;
}

int main() {
    int n; cin>>n;
    vector<int>arr(n);
    for(int i=0;i<n;i++) cin>>arr[i];
    vector<int>result=solve(arr);
    for (auto it:result) cout<<it<<" ";
    return 0;
}


Height Problem โœ…
#include<bits/stdc++.h>
#define ll long long
using namespace std;

ll solve(vector<int>a)
{
   set<int>s(a.begin(),a.end());
   ll mex=0;
    while (s.count(mex)) mex++;
   ll ans=distance(s.lower_bound(mex),s.end());
   if(ans==a.size()) return -2;
   return ans;
}
int main() {
    int n; cin>>n;
    vector<int>arr(n);
    for(int i=0;i<n;i++) cin>>arr[i];
    cout<<solve(arr);
    return 0;
}


Mex Numberโœ…
import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int energy = sc.nextInt();
        int maxDrink = sc.nextInt();
        int maxGoodEnergy = 0;
        int maxGoodNumber = 0;
        for (int i = 1; i <= maxDrink; i++) {
            int goodEnergy = energy * i;
            int goodNumber = 0;
            while (goodEnergy % 10 == 0) {
                goodNumber++;
                goodEnergy /= 10;
            }
            if (goodNumber > maxGoodNumber) {
                maxGoodNumber = goodNumber;
                maxGoodEnergy = energy * i;
            } else if (goodNumber == maxGoodNumber) {
                maxGoodEnergy = Math.max(maxGoodEnergy, energy * i);
            }
        }
        System.out.println(maxGoodEnergy);
    }
}

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

bool solve(char c) {
    c = tolower(c);
    return !(c == 'a' c == 'e' c == 'i' c == 'o' c == 'u') && c >= 'a' && c <= 'z';
}

int main() {
    string s;
    cin >> s;
    int count = 0;
    for(int i = 0; i < s.length(); i += 2) {
        if(solve(s[i])) {
            count++;
        }
    }
    cout << count << endl;
    return 0;
}

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

int main() {
    string s;
    cin >> s;
    int n = s.size();
    vector<int> prefix_b(n, 0);
    prefix_b[0] = (s[0] == 'b');
    for(int i = 1; i < n; i++) {
        prefix_b[i] = prefix_b[i-1] + (s[i] == 'b');
    }
    int ans = prefix_b[n-1];
    for(int i = 0; i < n; i++) {
        if(s[i] == 'a') {
            ans = min(ans, prefix_b[i] + (n - i - 1 - (prefix_b[n-1] - prefix_b[i])));
        }
    }
    cout << ans << endl;
    return 0;
}

Converter
Airtel Shecodesโœ…
#include <iostream>

using namespace std;

int main() {
    int e, d;
    cin >> e >> d;
   
    int mE = 0;
    int mN = 0;
   
    for (int i = 1; i <= d; i++) {
        int gE = e * i;
        int gN = 0;
       
        while (gE % 10 == 0) {
            gN++;
            gE /= 10;
        }
       
        if (gN > mN) {
            mN = gN;
            mE = e * i;
        } else if (gN == mN) {
            mE = max(mE, e * i);
        }
    }
   
    cout << mE << endl;
   
    return 0;
}


shecode goodenergy โœ…
๐Ÿ‘1
#include <bits/stdc++.h>
using namespace std;

#define ll long long

int main() {
    ll n;
    cin >> n;
    vector<ll> v(n);
    for(ll i=0; i<n; i++)
        cin >> v[i];

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

    ll sum = 0;
    for(ll i=0; i<n; i++) {
        if(sum + v[i] < 0)
            return cout << -1, 0;
        sum += v[i];
    }

    if(sum % 2 == 0)
        cout << -1;
    else
        cout << sum;

    return 0;
}


Shecode fortunejobโœ