๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.61K subscribers
5.61K photos
3 videos
95 files
10.6K 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 know you are all trying very hard and applying to 10s if not 100s of jobs everyday with no response or rejections in most.

Trust me this is the scenario with everyone you're not alone, I have faced it and still face it when I try my luck for International jobs.

The only thing which can keep you going is inner motivation and your family.

Do it for your loved ones and nothing can distract you.
I'm here to help in the best possible way.

Kudos for keep trying...โ™ฅ๏ธ๐Ÿš€
โค34๐Ÿ‘1๐Ÿคฉ1
import sys
def main():
    data = sys.stdin.read().split()
    N, K, Q = data[0], int(data[1]), int(data[2])
    queries = list(map(int, data[3:3+Q]))
    dp = 0
    for c in N:
        d = int(c)
        tmp = 1 << (d % K)
        for r in range(K):
            if dp & (1 << r):
                tmp |= 1 << ((r *10 + d) % K)
        dp |= tmp
    for x in queries:
        print("YES" if dp & (1 << x) else "NO")
if __name__ == "__main__":
    main()


A Reminder Problem โœ…
string solution() {
    string result;
    for (int i = 0; i < 100; i++) {
        if (i < 10) {
            result += "0" + to_string(i); 
        } else {
            result += to_string(i);      
        }
    }
    return result;
}
Palo Alto (SDE) โœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_set>
using namespace std;
int spreadInfection(vector<vector<int>>& adj, vector<int>& malware, int removeNode = -1) {
    int n = malware.size();
    vector<int> infected(n, 0);
    queue<int> q;
    for (int i = 0; i < n; i++) {
        if (malware[i] == 1 && i != removeNode) {
            q.push(i);
            infected[i] = 1;
        }
    }
    while (!q.empty()) {
        int node = q.front();
        q.pop();
       
        for (int neighbor : adj[node]) {
            if (infected[neighbor] == 0 && neighbor != removeNode) {
                infected[neighbor] = 1;
                q.push(neighbor);
            }
        }
    }
    int totalInfected = 0;
    for (int i = 0; i < n; i++) {
        if (infected[i] == 1) totalInfected++;
    }

    return totalInfected;
}
int minimizeMalwareSpread(int g_nodes, vector<int>& g_from, vector<int>& g_to, vector<int>& malware) {
    vector<vector<int>> adj(g_nodes);
    for (int i = 0; i < g_from.size(); i++) {
        adj[g_from[i] - 1].push_back(g_to[i] - 1);
        adj[g_to[i] - 1].push_back(g_from[i] - 1);
    }
    int baselineInfection = spreadInfection(adj, malware);
    int bestNode = -1;
    int minInfected = baselineInfection;
    for (int i = 0; i < g_nodes; i++) {
        if (malware[i] == 1) {
            int infectedCount = spreadInfection(adj, malware, i);
            if (infectedCount < minInfected || (infectedCount == minInfected && (bestNode == -1 || i < bestNode))) {
                minInfected = infectedCount;
                bestNode = i;
            }
        }
    }

    return bestNode + 1;
}


Salesforce โœ