๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.63K 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
LinkedIn Premium at a heavy discount for a 6-month subscription!

Aโ€Œcโ€Œtโ€Œuโ€Œaโ€Œlโ€Œ Pโ€Œrโ€Œiโ€Œcโ€Œeโ€Œ:โ€Œ 8โ€Œ5โ€Œ2โ€Œ0โ€Œ Iโ€ŒNโ€ŒRโ€Œ
Discounted Price: 850 INR

If you want pls below person on telegram: @suresh053

Person is totally trusted, no issue in that.

P.S: Will delete in sometime bcoz he have very limited number.
๐Ÿ‘1
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
def dfs(node, par, depth, graph, signal_speed):
    global cnt
    if depth % signal_speed == 0 and depth != 0:
        cnt += 1
    for neighbor, weight in graph[node]:
        if neighbor == par:
            continue
        dfs(neighbor, node, depth + weight, graph, signal_speed)

def getNumPairs(server_nodes, server_from, server_to, server_weight, signal_speed):
    graph = {}
    for i in range(server_nodes - 1):
        if server_from[i] not in graph:
            graph[server_from[i]] = []
        if server_to[i] not in graph:
            graph[server_to[i]] = []
        graph[server_from[i]].append((server_to[i], server_weight[i]))
        graph[server_to[i]].append((server_from[i], server_weight[i]))
    result = []
    for i in range(1, server_nodes + 1):
        global cnt
        cnt = 0
        dfs(i, i, 0, graph, signal_speed)
        result.append(cnt * (cnt - 1))
    return result

Oracle โœ…
๐Ÿ‘1
long long result = 0;

// Helper function to calculate
// the maximum path sum using DFS
long long findMaximumPathSum(int currentNode,
                        int previousNode,
                        const vector<vector<int>> &adj,
                        const vector<int> &A)
{
    // Nodes to which currentNode is
    // connected to
    const vector<int> &v = adj[currentNode];
    int maximumBranchSum1 = 0;
    int maximumBranchSum2 = 0;
    for (auto vtx : v) {
        // checking whether the branch is
        // visited already
        if (vtx == previousNode) {
            continue;
        }
        long long bs = findMaximumPathSum(vtx, currentNode,
                           adj, A);

        // Storing the maximum of value of
        // branch path sums
        // maximumBranchSum1 will store the
        // maximum value
        // maximumBranchSum2 will store the
        // 2nd most maximum value
        if (bs >= maximumBranchSum1) {
            maximumBranchSum2 = maximumBranchSum1;
            maximumBranchSum1 = bs;
        }
        else {
            maximumBranchSum2
                = max(maximumBranchSum2, bs);
        }
    }
    result = max(result,
                 A[currentNode] + maximumBranchSum1
                     + maximumBranchSum2);

    // updating the value of current value
    // with maximum path sum including
    // currentNode
    return A[currentNode] + maximumBranchSum1;
}


long long bestSumAnyTreePath(vector<int>& parents, vector<int>& values) {
    int n = parents.size();
    vector<vector<int>> mp(n);

    for (int i = 0; i < n; i++) {
        if (parents[i] != -1) {
            mp[parents[i]].push_back(i);
        }
    }

    result = 0;
    findMaximumSumPath(0, -1, mp, values);

    return result;
}

Best sum many treepath โœ…
Oracle
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
vector<long> bitwiseEquations(vector<long> a, vector<long> b)
{

    // long long x = 0, y = 0;
    int n = a.size();
    vector<long> ans(n);
    for (int i = 0; i < n; i++)
    {
        if (a[i] < b[i])
        {
            ans[i] = 0;
            continue;
        }
        long x = 0, y = 0;
        long diff = a[i] - b[i];
        diff /= 2;
        // cout << diff << endl;
        for (int j = 0; j < 64; j++)
        {
            if (b[i] & (1 << j))
            {
                if ((diff & (1 << j)) == 0)
                {
                    // x |= (1 << j);
                    y |= (1 << j);
                }
                else
                {
                    x = 0, y = 0;
                    break;
                }
            }
            else
            {
                if ((diff & (1 << j)))
                {
                    x |= (1 << j);
                    y |= (1 << j);
                }
            }
        }
        ans[i] = 2 * x + 3 * y;
    }
    return ans;
}

The bitwise Equation โœ…
def split_text_to_sms(text, limit):
    def suffix_length(x, y):
        return len(f"<{x}/{y}>")
    for y in range(1, len(text) + 1):
        max_content_length = limit - suffix_length(1, y)
        if max_content_length <= 0:
            continue
       
        messages = []
        current_start = 0
       
        while current_start < len(text):
            if current_start + max_content_length > len(text):
                end = len(text)
            else:
                end = current_start + max_content_length
           
            message_content = text[current_start:end]
            message_suffix = f"<{len(messages) + 1}/{y}>"
           
            if len(message_content) + len(message_suffix) > limit:
                break
           
            messages.append(message_content + message_suffix)
            current_start = end
       
        if len(messages) == y:
            return messages
   
    return []
int solution(const vector<int>& numbers) {
    int evenSum = 0;
    int oddSum = 0;
    for (int i = 0; i < numbers.size(); i++) {
        if (numbers[i] >= -100 && numbers[i] <= 100) {
            if (i % 2 == 0) {
                evenSum += numbers[i];
            } else {
                oddSum += numbers[i];
            }
        }
    }
   
    return evenSum - oddSum;
}
Need  Graduate Trainee โค๏ธ

Qualifications: BAMS, Any Graduate, B.Arch , B.Tech/B.E. , BCA , B.B.A/ B.M.S , ITI Certification , B.Sc in , B.Com , B.El.Ed , B.Ed , B.Des. , Diploma , B.A

Experience: 0 โ€“ 3 years

Job Type: Full Time

Location:  Pune

Skills/Requirements:
1. Ability to quickly learn and adjust to new tasks and environments.
2. Strong verbal and written communication to effectively interact with colleagues and supervisors.
3. Ability to assess information, solve problems, and make data-driven decisions.
4. Working collaboratively with others, contributing to team goals, and supporting peers.

Date of Interview: 2nd August โ€“ 10th August, 2024

Time:  8.30 AM โ€“ 12.30 PM

Join the Venue at TalentCorp Solutions Pvt Ltd Ground Floor, Soham Complex, Opposite Gajanan Hospital, Ranjangaon (Pune).
#include <bits/stdc++.h>
#define int long long
using namespace std;
class Tracker {
private:
    int n;
    vector<int> rowXor;
    vector<int> colXor;
    vector<vector<int>> grid;

    void updateXor(int r, int c, int s, bool add) {
        if (add) {
            rowXor[r] ^= s;
            colXor[c] ^= s;
        } else {
            rowXor[r] ^= s;
            colXor[c] ^= s;
        }
    }
   
    int countAttackable() {
        int count = 0;
        for (int r = 1; r <= n; ++r) {
            for (int c = 1; c <= n; ++c) {
                if ((rowXor[r] ^ colXor[c]) > 0) {
                    ++count;
                }
            }
        }
        return count;
    }

public:
    Tracker(int N) : n(N), rowXor(N + 1, 0), colXor(N + 1, 0), grid(N + 1, vector<int>(N + 1, 0)) {}

    void addPanda(int r, int c, int s) {
        if (grid[r][c] > 0) {
            updateXor(r, c, grid[r][c], false);
        }
        grid[r][c] = s;
        updateXor(r, c, s, true);
    }

    void movePanda(int r1, int c1, int r2, int c2) {
        if (grid[r1][c1] > 0) {
            updateXor(r1, c1, grid[r1][c1], false);
            addPanda(r2, c2, grid[r1][c1]);
            grid[r1][c1] = 0;
        }
    }

    void processMove(int r1, int c1, int r2, int c2) {
        movePanda(r1, c1, r2, c2);
        cout << countAttackable() << endl;
    }
};

void gameEngine(int N, int P, int M, int arr1[][3], int arr2[][4]) {
    Tracker trk(N);

    for (int i = 0; i < P; ++i) {
        int r = arr1[i][0];
        int c = arr1[i][1];
        int s = arr1[i][2];
        trk.addPanda(r, c, s);
    }

    for (int i = 0; i < M; ++i) {
        int r1 = arr2[i][0];
        int c1 = arr2[i][1];
        int r2 = arr2[i][2];
        int c2 = arr2[i][3];
        trk.processMove(r1, c1, r2, c2);
    }
}

int32_t main() {
    int n, p, m;
    cin >> n >> p >> m;
   
    int arr1[p][3];
    for (int i = 0; i < p; ++i) {
        for (int j = 0; j < 3; ++j) {
            cin >> arr1[i][j];
        }
    }

    int arr2[m][4];
    for (int i = 0; i < m; ++i) {
        for (int j = 0; j < 4; ++j) {
            cin >> arr2[i][j];
        }
    }

    gameEngine(n, p, m, arr1, arr2);

    return 0;
}


Multi Panda โœ…
GS
#include <bits/stdc++.h>
using namespace std;
void generateresult(const string& s) {
    regex zero_regex("0+");
    sregex_token_iterator it(s.begin(), s.end(), zero_regex, -1);
    sregex_token_iterator end;
    vector<string> ans;
   
    for (; it != end; ++it) {
        ans.push_back(*it);
    }
   
    for (const auto& substr : ans) {
        cout << substr << endl;
    }
}

int main() {
    string s;
    getline(cin, s);
    generateresult(s);
    return 0;
}


Employee Details
GSโœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <iostream>
#include <vector>
#include <unordered_map>
#define int long long
using namespace std;

class Tracker {
private:
    int n;
    vector<int> rowXor;
    vector<int> colXor;
    vector<vector<int>> grid;

    void updateXor(int r, int c, int s, bool add) {
        if (add) {
            rowXor[r] ^= s;
            colXor[c] ^= s;
        } else {
            rowXor[r] ^= s;
            colXor[c] ^= s;
        }
    }
   
    int countAttackable() {
        int count = 0;
        for (int r = 1; r <= n; ++r) {
            for (int c = 1; c <= n; ++c) {
                if ((rowXor[r] ^ colXor[c]) > 0) {
                    ++count;
                }
            }
        }
        return count;
    }

public:
    Tracker(int N) : n(N), rowXor(N + 1, 0), colXor(N + 1, 0), grid(N + 1, vector<int>(N + 1, 0)) {}

    void addPanda(int r, int c, int s) {
        if (grid[r][c] > 0) {
            updateXor(r, c, grid[r][c], false);
        }
        grid[r][c] = s;
        updateXor(r, c, s, true);
    }

    void movePanda(int r1, int c1, int r2, int c2) {
        if (grid[r1][c1] > 0) {
            updateXor(r1, c1, grid[r1][c1], false);
            addPanda(r2, c2, grid[r1][c1]);
            grid[r1][c1] = 0;
        }
    }

    void processMove(int r1, int c1, int r2, int c2) {
        movePanda(r1, c1, r2, c2);
        cout << countAttackable() << endl;
    }
};

signed main() {
    int N, P, M;
    cin >> N >> P >> M;

    Tracker trk(N);

    for (int i = 0; i < P; ++i) {
        int r, c, s;
        cin >> r >> c >> s;
        trk.addPanda(r, c, s);
    }

    for (int i = 0; i < M; ++i) {
        int r1, c1, r2, c2;
        cin >> r1 >> c1 >> r2 >> c2;
        trk.processMove(r1, c1, r2, c2);
    }

    return 0;
}
๐Ÿ‘1