๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.52K subscribers
5.56K photos
3 videos
95 files
9.65K 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<bits/stdc++.h>
using namespace std;

const int MOD = 1e9 + 7;
vector<vector<vector<string>>> dp;

vector<string> solve(string& alice, string& bob, int i, int j) {
    if(i == alice.size() || j == bob.size()) {
        return {""};
    }
    if(dp[i][j].size() != 0) {
        return dp[i][j];
    }
    if(alice[i] == bob[j]) {
        vector<string> tmp = solve(alice, bob, i+1, j+1);
        for(string& s : tmp) {
            s = alice[i] + s;
        }
        return dp[i][j] = tmp;
    }
    vector<string> left = solve(alice, bob, i+1, j);
    vector<string> right = solve(alice, bob, i, j+1);
    if(left[0].size() > right[0].size()) {
        return dp[i][j] = left;
    }
    if(left[0].size() < right[0].size()) {
        return dp[i][j] = right;
    }
    left.insert(left.end(), right.begin(), right.end());
    sort(left.begin(), left.end());
    left.erase(unique(left.begin(), left.end()), left.end());
    return dp[i][j] = left;
}

int main() {
    int T;
    cin >> T;
    while(T--) {
        string alice, bob;
        cin >> alice >> bob;
        dp = vector<vector<vector<string>>>(alice.size(), vector<vector<string>>(bob.size()));
        vector<string> trips = solve(alice, bob, 0, 0);
        for(string& trip : trips) {
            cout << trip << endl;
        }
    }
    return 0;
}

INFAthon 4.0โœ…
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

class Solution {
public:
    int maxSumOptimalArrangement(vector<int>& coins) {
        vector<int> positive;
        vector<int> negative;

        for (int coin : coins) {
            if (coin >= 0)
                positive.push_back(coin);
            else
                negative.push_back(coin);
        }

        sort(positive.rbegin(), positive.rend());
       
        sort(negative.begin(), negative.end());

        int totalSum = 0;

        for (size_t i = 0; i < max(positive.size(), negative.size()); ++i) {
            if (i < positive.size())
                totalSum += positive[i];
            if (i < negative.size())
                totalSum -= negative[i];
        }

        return totalSum;
    }
};

ZS campus beat code question :

Circuit Board โœ…
int solve(vector<int>& xp) {
    sort(xp.begin(), xp.end());
    set<double> s;
    int i = 0, j = xp.size() - 1;

    while (i < j) {
        double a = (xp[i] + xp[j]) / 2.0;
        s.insert(a);
        i++;
        j--;
    }

    return s.size();
}

Amazon โœ…
Android App Developer (INTERN) at Petuk Ji
Working hours : 6 hours a day (Stay Connected on google meet during working hours)
Weekly Off: 6 Days a week
Stipend: - Rating Based (FEE - 3000 EE - 2500 ME - 2000 BE - 0,00 )
Min. Duration - 3 Month.

https://www.linkedin.com/jobs/view/3908383748

NOTE: Very low stipend so apply at own risk
Hi Connections,

Urgent Hiring for Security Analyst for Noida & Mumbai Location.
Exp- 0-2+ Years.
Candidate should be good knowledge of MS office.
Candidate should have good communication skills.

Interested candidates can send their cv at yogesh@tophire.in
int main()
{
    string text;
    getline(cin, text);

    int index = 0;

    while (index + 13 < text.length() && (index = text.rfind(" ", index + 13)) != string::npos) {
        text.replace(index, 1, "\n");
    }

    cout << text << endl;

    return 0;
}


INFA thon 4.0โœ