๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.62K 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
public class Solution {
    public static int countOfElement(int[] listInput1, int[] listInput2) {
        HashSet<Integer> set1 = new HashSet<>();
        HashSet<Integer> set2 = new HashSet<>();

     
        for (int num : listInput1) {
            set1.add(num);
        }

       
        for (int num : listInput2) {
            set2.add(num);
        }

      
        int count = 0;
        for (int num : listInput1) {
            if (!set2.contains(num)) {
                count++;
            }
        }
        for (int num : listInput2) {
            if (!set1.contains(num)) {
                count++;
            }
        }

        return count;
    }
}
class UserMainCode(object):
    @classmethod
    def qualifyingScore(cls, total_scores, num_top_scores, scores, weights):
        weighted_scores = [score -weight for score, weight in zip(scores, weights)]
        weighted_scores.sort(reverse=True)
        top_scores_sum = sum(weighted_scores[:num_top_scores])
        if top_scores_sum >= 35:
            return f"Qualified {top_scores_sum}"
        else:
            return f"Disqualified {top_scores_sum}"


Qualifying Score โœ…
void replaceValues(int SIZE, int arr[])
{
    int i=0;
    while(i<SIZE){
        if(SIZE%2==0){
            arr[i]=0;
        }
        else{
            arr[i]=1;
        }
        i+=1;
    }
}


Morgan Stanley โœ…
๐Ÿ‘1
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int ss(int a, vector<int>& b, int c, int s) {
    sort(b.begin(), b.end());
    int count = 0;
    for (int i = 0; i < a; ++i) {
        int current_capacity = b[i];
                int low = c - current_capacity;
        int high = s - current_capacity;
       
        auto left_index = lower_bound(b.begin() + i + 1, b.end(), low);
        auto right_index = upper_bound(b.begin() + i + 1, b.end(), high);
       
        // Count valid pairs
        count += distance(left_index, right_index);
    }

    return count;
}

int main() {
    int a; 
    cin >> a;
   
    vector<int> b(a);
    for (int i = 0; i < a; ++i) {
        cin >> b[i];
    }
   
    int c, s;
    cin >> c >> s;
   
    cout << ss(a, b, c, s) << endl;

    return 0;
}


MS electic powerโœ…
Morgan Stanley
๐Ÿ‘1
#include <vector>
#include <string>
#include <algorithm>
#include <iostream>

using namespace std;

class node {
public:
    long long ind;
    char c;
    long long t;

    node() {}

    node(long long ind, char c, long long t) {
        this->ind = ind;
        this->c = c;
        this->t = t;
    }
};

bool cmp(const node &a, const node &b) {
    return a.ind < b.ind;
}

vector<string> fun(int n, vector<pair<int, char>> messages) {
    vector<node> v(n);
    for (int i = 0; i < n; i++) {
        long long ind = messages[i].first;
        char c = messages[i].second;
        long long t = i;
        node temp(ind, c, t);
        v[i] = temp;
    }

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

    vector<pair<long long, string>> check;
    vector<string> ans;

    for (int i = 0; i < n; i++) {
        if (v[i].c == '*') {
            int j = i + 1;
            while (j < n && v[j].c != '*' && v[j - 1].ind + 1 == v[j].ind) j++;
            if (j < n && v[j].c == '*') {
                long long mx = 0;
                string temp = "";
                for (int k = i + 1; k < j; k++) temp.push_back(v[k].c);
                for (int k = i; k <= j; k++) mx = max(mx, v[k].t);
                check.push_back({mx, temp});
            }
        }
    }

    sort(check.begin(), check.end(), [](const pair<long long, string> &a, const pair<long long, string> &b) {
        return a.first > b.first;
    });

    for (const auto &entry : check) ans.push_back(entry.second);

    return ans;
}

int main() {
    vector<pair<int, char>> in = {{693232583, '*'}, {1, '*'}, {2, 'a'}, {693232585, '*'}, {3, '*'}, {693232584, 'w'}};
    int n = in.size();

    vector<string> result = fun(n, in);

    for (const string &str : result) {
        cout << str << endl;
    }

    return 0;
}

Message passing โœ…
Morgan Stanley
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
    int minSideJumps(vector<int>& obstacles) {
        const int inf = 1 << 30; 
        vector<int> f(3, inf);   
        f[1] = 0;              

        for (int i = 0; i < obstacles.size(); ++i) {
            vector<int> new_f(3, inf); 
            for (int j = 0; j < 3; ++j) {
                if (obstacles[i] != j + 1) {
                    new_f[j] = min(f[j], min({f[(j + 1) % 3], f[(j + 2) % 3]}) + 1);
                }
            }
                        f = new_f;
        }
        return min({f[0], f[1], f[2]});
    }
};
#include <bits/stdc++.h>
using namespace std;
long long getMinimumTotalCost(vector<int>& weights, int k) {
    vector<int> adjSums;
    int n = weights.size();
    for (int i = 0; i < n - 1; i++) {
        adjSums.push_back(weights[i] + weights[i + 1]);
    }
    sort(adjSums.begin(), adjSums.end());
    long long minCost = weights[0] + weights[n - 1];
    for (int i = 0; i < k - 1; i++) {
        minCost += adjSums[i];
    }
    return minCost;
}
vector<vector<int>> precompute_extra_time(const string &s) {
    int n = s.length();
    vector<vector<int>> extra_time(n, vector<int>(n, 0));

    for (int i = 0; i < n; i++) {
        vector<int> freq(26, 0);
        for (int j = i; j < n; j++) {
            freq[s[j] - 'a']++;
            int pairs = 0;
            for (int f : freq) if (f > 1) pairs += (f * (f - 1)) / 2;
            extra_time[i][j] = pairs;
        }
    }

    return extra_time;
}

int getMinTotalExtraTime(string s, int k) {
    int n = s.length();
    vector<vector<int>> extra_time = precompute_extra_time(s);
   
    vector<int> dp(n + 1, INT_MAX);
    dp[0] = 0;

    for (int i = 1; i <= n; i++) {
        for (int j = 0; j < i; j++) {
            dp[i] = min(dp[i], dp[j] + extra_time[j][i - 1] + k);
        }
    }

    return dp[n] - k;
}

DE Shaw โœ…
#include <iostream>
#include <vector>
int GameChallenge(vector<int>& arr) {
    int nim_sum = 0;
        for(int coins : arr) {
        nim_sum ^= coins;
    }
        return (nim_sum == 0) ? 2 : 1;
}

Atlas โœ…
https://www.naukri.com/job-listings-it-intern-leuwint-technologies-palakkad-0-to-1-years-110924906843?src=cluster&sid=17260519887449949_2&xp=6&px=1&nignbevent_src=jobsearchDeskGNB

Leuwint Technologies Hiring IT Intern

Completed a degree in Computer Science, Software Engineering, or a related field.(2022- 2024 pass out)
Proficiency in at least one programming language, such as Java, Python, C++, JavaScript, or similar.
Familiarity with web development (HTML, CSS, JavaScript) or mobile app development (iOS, Android) is a plus.
Ability to work collaboratively in a team environment.