๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.64K subscribers
5.6K photos
3 videos
95 files
10.3K 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
Accenture Bulk Hiring .

Customer Support Associate - UK & US Clients.

Hiring 300 candidates for Accenture Bengaluru, Mumbai and Delhi NCR offices

Any Batch , Any degree is eligible

Package is 3.5-6.5 Lpa

Apply link :-
https://bit.ly/3yr52zo

Guys Donโ€™t miss the opportunity.
๐Ÿ‘1
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
    long long a, b;
    cin >> a;
    vector<long long> n(a);
    for (long long i = 0; i < a; ++i)
    cin >> n[i];
    cin >> b;
    vector<long long> r(b);
    for (long long i = 0; i < b; ++i)
        cin >> r[i];
    vector<long long> d(r.begin(), r.begin() + a);
    d.insert(d.end(), r.begin(), r.end());
    vector<long long> initial_diff;
    initial_diff.reserve(a);
    for (long long i = 0; i < a; ++i)
    initial_diff.push_back(abs(n[i] - d[i]));
    if (all_of(initial_diff.begin() + 1, initial_diff.end(), &
    {
        return x == initial_diff[0]; }))
    {
        cout << initial_diff[0] << endl;
    }
    else
    {
        for (long long i = 1; i < b; ++i) {
            vector<long long> window(d.begin() + i, d.begin() + i + a);
            vector<long long> diff;
            diff.reserve(a);
            transform(n.begin(), n.end(), window.begin(), back_inserter(diff), [](long long x, long long y)
            {
            return abs(x - y); });
            if (all_of(diff.begin() + 1, diff.end(), &
            {
                return x == diff[0]; }))
                {
                cout << diff[0] << endl;
                break;
            }
        }
    }
    return 0;
}

Morgan Stanley โœ…
#include <iostream>
#include <string>

using namespace std;

string getNextSequence(const string &s) {
    string result = "";
    int count = 1;
   
    for (size_t i = 1; i <= s.length(); ++i) {
        if (i < s.length() && s[i] == s[i - 1]) {
            ++count;
        } else {
            result += to_string(count) + s[i - 1];
            count = 1;
        }
    }
   
    return result;
}

string getNthPasscode(long long n) {
    if (n == 1) {
        return "1";
    }

    string result = "1";
    for (long long i = 2; i <= n; ++i) {
        result = getNextSequence(result);
    }
   
    return result;
}

int main() {
    long long smartCardNumber;
    cin >> smartCardNumber;
   
    string passcode = getNthPasscode(smartCardNumber);
    cout << passcode << endl;
   
    return 0;
}

Morgan Stanley โœ…
๐Ÿ‘1
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>

using namespace std;

long long findTeaserLevels(vector<long long>& levelValues, long long threshold) {
    sort(levelValues.begin(), levelValues.end());
    long long closestSum = LLONG_MIN;

    for (size_t i = 0; i < levelValues.size() - 2; ++i) {
        size_t left = i + 1;
        size_t right = levelValues.size() - 1;

        while (left < right) {
            long long currentSum = levelValues[i] + levelValues[left] + levelValues[right];

            if (currentSum <= threshold) {
                if (currentSum > closestSum) {
                    closestSum = currentSum;
                }
                ++left;
            } else {
                --right;
            }
        }
    }

    return closestSum == LLONG_MIN ? -1 : closestSum;
}

int main() {
    int levelValuesSize;
    cin >> levelValuesSize;

    vector<long long> levelValues(levelValuesSize);
    for (int i = 0; i < levelValuesSize; ++i) {
        cin >> levelValues[i];
    }

    long long thresholdValue;
    cin >> thresholdValue;

    long long result = findTeaserLevels(levelValues, thresholdValue);
    if (result == -1) {
        cout << "NA" << endl;
    } else {
        cout << result << endl;
    }

    return 0;
}

Morgan Stanley โœ…
Wipro is Inviting applications of (Analyst) for Gurgaon office.
Candidates with an experience range of 0 - 1 yr. Only, comfortable with US shifts, can send their CV's to ayaan.hossain@wipro.com with the below details.

Role- Analyst
Desired Candidate Profile:
Should be flexible working in Shifts.
Experience- 0 yrs. to 1 yrs.
Qualification- MBA/M.com/ B.com/BBA.
Location- Gurgaon (Work From Office Only)
Looking for Immediate Joiners
Genpact is hiring !

Skill set- P&C Insurance
Experience - 0-3 years (Freshers can Apply)
Location - Noida
Shift- APAC shift
Qualification - Any except technical

GOOD COMMUNICATION REQUIRED.

Note- Interested candidate can share their CV at rangoli.bhatt@genpact.com with the subject line "Application for Insurance "
int countSetBits(int n) {
    int count = 0;
    while (n) {
        count += n & 1;
        n >>= 1;
    }
    return count;
}

int countSubsetsWithSumSetBitsEqualToK(const vector<int>& arr, int k) {
    int n = arr.size();
    int subsetCount = 0;
    int totalSubsets = 1 << n;

    for (int i = 0; i < totalSubsets; ++i) {
        int subsetSum = 0;
        for (int j = 0; j < n; ++j) {
            if (i & (1 << j)) {
                subsetSum += arr[j];
            }
        }
        if (countSetBits(subsetSum) == k) {
            ++subsetCount;
        }
    }

    return subsetCount;
}

Hack on Amazon โœ…
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

int calculate_operations(std::vector<int>& arr, int target) {
    int operations = 0;
    for (int num : arr) {
        operations += std::abs(num - target);
    }
    return operations;
}

int main() {
    int N;
    std::cin >> N;
    std::vector<int> A(N);
   
    for (int i = 0; i < N; ++i) {
        std::cin >> A[i];
    }

    std::sort(A.begin(), A.end());
        int median = A[N / 2];
  
    int min_operations = calculate_operations(A, median);

    for (int i = 0; i < N; ++i) {
        int original_value = A[i];
        A[i] = median;
        int operations_with_free_move = calculate_operations(A, median);
        min_operations = std::min(min_operations, operations_with_free_move);
        A[i] = original_value;
    }

    std::cout << min_operations << std::endl;

    return 0;
}

Hack on Amazon โœ