๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.57K subscribers
5.59K photos
3 videos
95 files
10K 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
I am looking for a motivated Fresher to join in Bangalore. This role will involve providing HR support and managing coordination tasks within the HR department.

Role -  HR Apprentice 
Location -  Bangalore 
Start Date -  Immediate 
Qualification MBA in HR (Fresher) 
Preferred Candidate Female 
Essential Skills - Proficient in MS Excel, good communication, and coordination skills

Email resume - reetikaraj@fedfina.com
โค2๐Ÿ‘2
โ€œเคœเคฌ เคœเคฌ เคนเฅ‹เคˆ เคงเคฐเคฎ เค•เฅ€ เคนเคพเคจเฅ€, เคฌเคพเคขเคผเคนเคฟ เค…เคธเฅเคฐ เค…เคงเคฎ เค…เคญเคฟเคฎเคพเคจเฅ€เฅค เคคเคฌ-เคคเคฌ เคงเคฐเคฟ เคชเฅเคฐเคญเฅ เคตเคฟเคตเคฟเคง เคถเคฐเฅ€เคฐเคพ, เคนเคฐเคนเคฟ เคฆเคฏเคพเคจเคฟเคงเคฟ เคธเคœเฅเคœเคจ เคชเฅ€เคฐเคพเฅคเฅคโ€
LinkedIn SDE Intern Opening that I shared a few weeks ago

Test 1 is already done, Have you given it ?


Test 2 is today, Have you got the link?

All the best โ™ฅ๏ธ
๐Ÿ‘5โค2๐Ÿคฉ1
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <bits/stdc++.h>

using namespace std;


/*
* Complete the 'countGoodSubsequences' function below.
*
* The function is expected to return an INTEGER.
* The function accepts STRING word as parameter.
*/
const int M = 1000000007;

    int add(int x, int y) {
        if ((x += y) >= M) {
            x -= M;
        }
        return x;
    }

    int mul(long long x, long long y) {
        return x * y % M;
    }

    int rev(int x) {
        int r = 1;
        for (int y = M - 2; y; y >>= 1) {
            if (y & 1) {
                r = mul(r, x);
            }
            x = mul(x, x);
        }
        return r;
    }

int countGoodSubsequences(string s) {
unordered_map<char, int> have;
        for (char c : s) {
            ++have[c];
        }
        const int n = s.length();
        vector<int> r(n + 1);
        for (int i = 1; i <= n; ++i) {
            r[i] = rev(i);
        }
        vector<int> dp(n + 1);
        int m = 0;
        for (const auto& p : have) {
            m = max(m, p.second);
            for (int i = 1, t = 1; i <= p.second; ++i) {
                t = mul(mul(t, p.second - i + 1), r[i]);
                dp[i] = add(mul(dp[i], t + 1), t);
            }
        }
        int ans = 0;
        for (int i = 1; i <= m; ++i) {
            ans = add(ans, dp[i]);
        }
        return ans;
}

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

const int MOD = 1e9 + 7;

long long comb3(long long n) {
    if (n < 3) return 0;
    return ((n * (n - 1) % MOD) * (n - 2) % MOD) / 6 % MOD;
}

int countEvenProductTriplets(const vector<int>& arr) {
    int n = arr.size();
    int odd_count = 0, even_count = 0;
    for (int num : arr) {
        if (num % 2 == 0) {
            even_count++;
        } else {
            odd_count++;
        }
    }

    long long total_triplets = comb3(n);
    long long odd_triplets = comb3(odd_count);

    long long result = (total_triplets - odd_triplets + MOD) % MOD;

    return (int)result;
}


LinkedIn โœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
public static long getMinimumCost(int edgeDeviceCost, int inputPeripheralCost, int bundleCost, int x, int y) {
        long minCost = Long.MAX_VALUE;

        for (int bundles = 0; bundles <= Math.max(x, y); bundles++) {
            int remainingEdgeDevices = Math.max(0, x - bundles);
            int remainingPeripherals = Math.max(0, y - bundles);

            long cost = (long) bundles * bundleCost
                    + (long) remainingEdgeDevices * edgeDeviceCost
                    + (long) remainingPeripherals * inputPeripheralCost;

            minCost = Math.min(minCost, cost);
        }

        return minCost;
    }


LinkedIn โœ…
def simpleCipher(encrypted, k):
    k = k % 26
    decrypted = []
    for char in encrypted:
        old_pos = ord(char) - ord('A')
        new_pos = (old_pos - k) % 26
        new_char = chr(new_pos + ord('A'))
        decrypted.append(new_char)
    return ''.join(decrypted)

LinkedIn โœ…
typedef long long ll;
const int MOD = 1e9 + 7;
ll comb3(ll n) {
    if(n < 3) return 0;
    ll res = n;
    res = res * (n - 1) % MOD;
    res = res * (n - 2) % MOD;
    ll inv6 = 166666668;
    res = res * inv6 % MOD;
    return res;
}

int evenproduct(vector<int> &nums) {
    ll n = nums.size();
    ll even = 0, odd = 0;
    for(auto num : nums){
        if(num % 2 == 0) even++;
        else odd++;
    }
    ll total = comb3(n);
    ll all_odd = comb3(odd);
    ll valid = (total - all_odd + MOD) % MOD;
    return (int)valid;
}

LinkedIn โœ…
Credit : ishaan
typedef long long ll;
ll getMinOperations(vector<int> &change, vector<int> &arr)
{
    int n = change.size(), m = arr.size();
    vector<int> hasSetOperation(m + 1, 0);

    for (int i = 0; i < n; ++i)
    {
        if (change[i] > 0 && change[i] <= m)
        {
            hasSetOperation[change[i]] = 1;
        }
    }
    for (int j = 1; j <= m; ++j)
    {
        if (hasSetOperation[j] == 0)
        {
            return -1;
        }
    }

    ll total_decrements = 0;
    for (auto val : arr)
    {
        total_decrements += (ll)val;
    }

    ll total_sets = (ll)m;
    ll total_operations = total_decrements + total_sets;

    if (total_operations <= (ll)n)
    {
        return total_operations;
    }
    else
    {
        return -1;
    }
}

Minimum operation
LinkedInโœ…
๐Ÿ‘1
static final int MOD = (int)1e9 + 7;

    public static int countGoodSubsequences(String word) {
        int[] freq = new int[26];
        int maxFreq = 0;
        for (char c : word.toCharArray()) {
            freq[c - 'a']++;
            maxFreq = Math.max(maxFreq, freq[c - 'a']);
        }

        int n = word.length();
        long[] factorial = new long[maxFreq + 1];
        long[] invFactorial = new long[maxFreq + 1];
        factorial[0] = invFactorial[0] = 1;

        for (int i = 1; i <= maxFreq; i++) {
            factorial[i] = factorial[i - 1] * i % MOD;
        }

        invFactorial[maxFreq] = modInverse(factorial[maxFreq], MOD);
        for (int i = maxFreq - 1; i >= 1; i--) {
            invFactorial[i] = invFactorial[i + 1] * (i + 1) % MOD;
        }

        long totalGoodSequences = 0;

        for (int k = 1; k <= maxFreq; k++) {
            long total_k = 1;
            boolean hasValidChar = false;
            for (int i = 0; i < 26; i++) {
                if (freq[i] >= k) {
                    hasValidChar = true;
                    long c = comb(freq[i], k, factorial, invFactorial);
                    total_k = total_k * (c + 1) % MOD;
                }
            }
            if (hasValidChar) {
                total_k = (total_k - 1 + MOD) % MOD;
                totalGoodSequences = (totalGoodSequences + total_k) % MOD;
            }
        }

        return (int) totalGoodSequences;
    }

    static long modInverse(long a, int mod) {
        return modPow(a, mod - 2, mod);
    }

    static long modPow(long a, long b, int mod) {
        long result = 1;
        a %= mod;
        while (b > 0) {
            if ((b & 1) == 1)
                result = result * a % mod;
            a = a * a % mod;
            b >>= 1;
        }
        return result;
    }

    static long comb(int n, int k, long[] factorial, long[] invFactorial) {
        if (k > n) return 0;
        return factorial[n] * invFactorial[k] % MOD * invFactorial[n - k] % MOD;
    }


Good sequence
LinkedIn โœ…
โค1๐Ÿ‘1