๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.63K 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
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 โœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <iostream>
#include <vector>
using namespace std;
struct Edge {
    int to;
    bool visited;
};
void dfs(int node, vector<vector<Edge>>& tree, vector<bool>& visited) {
    visited[node] = true;
    for (auto& edge : tree[node]) {
        if (!visited[edge.to]) {
            if (!edge.visited) {
                edge.visited = true;
                for (auto& reverseEdge : tree[edge.to]) {
                    if (reverseEdge.to == node) {
                        reverseEdge.visited = true;
                        break;
                    }
                }
                dfs(edge.to, tree, visited);
            }
        }
    }
}
int main() {
    int N;
    cin >> N;
   
    vector<vector<Edge>> tree(N + 1);
    for (int i = 0; i < N - 1; ++i) {
        int u, v, c;
        cin >> u >> v >> c;
        tree[u].push_back({v, c == 1});
        tree[v].push_back({u, c == 1});
    }
    vector<bool> visited(N + 1, false);
    int carCount = 0;
    for (int i = 2; i <= N; ++i) {
        if (!visited[i]) {
            for (auto& edge : tree[i]) {
                if (edge.to == 1 && !edge.visited) {
                    edge.visited = true;
                    for (auto& reverseEdge : tree[1]) {
                        if (reverseEdge.to == i) {
                            reverseEdge.visited = true;
                            break;
                        }
                    }
                    carCount++;
                    dfs(i, tree, visited);
                    break;
                }
            }
        }
    }
    cout << carCount << endl;

    return 0;
}

Hack on Amazon โœ…
๐Ÿ‘1
Free Certification Courses

1) JavaScript Fundamentals
2) SQL
3) Git and GitHub
4) HTML and CSS
5) Basic projects
6) OOPs (Newly added)

This are the 5 courses which are available for free, and when you will join corporate this are the basic requirements.

Link: https://bit.ly/4avpEUz

Limited time ke liye hai, enroll as soon as possible (Isse pehle paid krde) ๐Ÿคž๐Ÿคž
int x(vector<int>& nums){
    int cnt=1;
    for(int i=0; i<nums.size()-1; i++){
        if(nums[i]>nums[i+1]){
            cnt++;
        }
    }
    return cnt;
}

Hack on Amazon โœ…
#include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main(){
    // int t;
    // cin >> t;
    // while(t--){
    int n ;
    cin >> n ;
    vector<int> vec(n);
    for(int i = 0 ;i < n ; ++i){
        cin >> vec[i];
    }
    sort(vec.begin(),vec.end());
    for(auto it : vec)
        cout << it << " ";
    cout << "\n";
    // }
}


Hack on Amazon โœ…
#include <iostream>
using namespace std;

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

    int totalCoins = 0;
    int i = 1;
    while (true) {
        int coins = N / i;
        if (coins < 1) {
            break;
        }
        totalCoins += coins;
        i++;
    }

    cout << totalCoins << endl;

    return 0;
}

Hack on Amazon โœ…
๐Ÿ‘1
#include <iostream>

using namespace std;

const int MOD = 1e9 + 7;

long long binomialCoefficient(int n, int k) {
    if (k > n - k) {
        k = n - k;
    }
    long long res = 1;
    for (int i = 0; i < k; ++i) {
        res = (res * (n - i)) % MOD;
        res /= (i + 1);
    }
    return res % MOD;
}

int countDistinctSequences(int x, int y) {
    return binomialCoefficient(y - 1, x - 1);
}

int main() {
    int x, y;
    cin >> x >> y;

    int result = countDistinctSequences(x, y);
    cout << result << endl;

    return 0;
}

Hacks on Amazon โœ…
๐Ÿ‘2
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

string lexicographicallySmallest(string P, string Q) {
    int N = P.size();
    for (int i = 0; i < N; ++i) {
        if (P[i] == Q[i]) {
            char replacement = 'a';
            while (replacement == P[i] || replacement == Q[i]) {
                replacement++;
            }
            P[i] = replacement;
        }
    }
    return P;
}

int main() {
    int N;
    string P, Q;
    cin >> N >> P >> Q;

    string result = lexicographicallySmallest(P, Q);
    cout << result << endl;

    return 0;
}

Hacks on Amazon โœ…
๐Ÿ‘1
Deloitte is looking for potential candidates in Risk Consulting Profile
Hiring for Analyst/Senior Analyst positions
Educational Qualifications- Graduate
Work Experience- 0-2 years
Skills-
โ€ขStrong writing skills- Excellent command over written English
โ€ขAbility to work independently with minimal supervision
โ€ขHigh standard of accuracy and eye for detail
โ€ขExcellent time management skill

If interested, kindly share your updated CV with sakshide21@gmail.com with subject as - RA_Analyst/ Senior Analyst
SPHERE.IO IS HIRING!!!

https://www.linkedin.com/company/spehre-io/

Contact the HR for further processing

https://www.linkedin.com/in/asmita-santra-238364226?

Or Email the cv at :  asmitasantra04@gmail.com

BCOM, M.COM, B.SC,M.SC, BA, MA CAN APPLY

NON IT DOMAIN CANDIDATES
NO B.TECH, M.TECH, BCA, MCA

*ABOUT COMPANY:-*
Spehre is a platform for building a comprehensive professional profile. Its AI rating system evaluates the educational background, work experience, and skillset of users to create a unique rating that reflects their qualifications and capabilities. Recruiters can use Spehre to match job requirements with Spehre-rated candidates, streamlining the hiring process.

*CRITERIA*:-

Under Graduates/ Graduates/ Freshers

*DURATION* :-  2 months (remote internship)

*ON COMPLETION* :-

- Various Certificates
- Performance Based Stipend (up to 10k)
- Letter of Recommendation
- PPO (if you perform well)
๐Ÿ‘1