๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
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
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int dfs(int node, int parent, vector<vector<pair<int, int>>>& adj, vector<bool>& visited) {
    visited[node] = true;
    int total_flow = 0;

    for (auto& neighbor : adj[node]) {
        int next_node = neighbor.first;
        int rate = neighbor.second;

        if (!visited[next_node]) {
            int flow = dfs(next_node, node, adj, visited);
            total_flow += min(flow, rate);
        }
    }

    return total_flow == 0 ? 1e9 : total_flow; // For leaf nodes return a large number
}

int oilTransport(int num, int baseR, vector<vector<int>>& pipesCon) {
    vector<vector<pair<int, int>>> adj(num + 1);
   
    for (const auto& pipe : pipesCon) {
        adj[pipe[0]].push_back({pipe[1], pipe[2]});
        adj[pipe[1]].push_back({pipe[0], pipe[2]});
    }

    vector<bool> visited(num + 1, false);
    return dfs(baseR, -1, adj, visited);
}

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

    int baseR;
    cin >> baseR;

    int numCon, charCon;
    cin >> numCon >> charCon;

    vector<vector<int>> pipesCon(numCon, vector<int>(charCon));
    for (int i = 0; i < numCon; i++) {
        for (int j = 0; j < charCon; j++) {
            cin >> pipesCon[i][j];
        }
    }

    cout << oilTransport(num, baseR, pipesCon) << endl;

    return 0;
}

SAP Labs โœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <iostream>
#include <vector>
#include <queue>
#include <climits>
using namespace std;
const int directions[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
vector<vector<int>> closestDis(const vector<vector<int>>& aerialView) {
    int M = aerialView.size();
    int N = aerialView[0].size();
        vector<vector<int>> distance(M, vector<int>(N, INT_MAX));
   
    queue<pair<int, int>> q;
    for (int i = 0; i < M; ++i) {
        for (int j = 0; j < N; ++j) {
            if (aerialView[i][j] == 1) {
                q.push({i, j});
                distance[i][j] = 0;
            }
        }
    }

    while (!q.empty()) {
        auto [x, y] = q.front();
        q.pop();
       
        for (const auto& dir : directions) {
            int nx = x + dir[0];
            int ny = y + dir[1];
           
            if (nx >= 0 && ny >= 0 && nx < M && ny < N) {
                if (distance[nx][ny] > distance[x][y] + 1) {
                    distance[nx][ny] = distance[x][y] + 1;
                    q.push({nx, ny});
                }
            }
        }
    }

    return distance;
}

int main() {
    int M, N;
    cin >> M >> N;
    vector<vector<int>> aerialView(M, vector<int>(N));
    for (int i = 0; i < M; ++i) {
        for (int j = 0; j < N; ++j) {
            cin >> aerialView[i][j];
        }
    }
    vector<vector<int>> result = closestDis(aerialView);
    for (const auto& row : result) {
        for (int cell : row) {
            cout << cell << " ";
        }
        cout << endl;
    }
   
    return 0;
}


SAP Labs โœ…
int main() {
    string word="civil";

    for (char c : word) {
        if (isalpha(c)) {
            int code = toupper(c) - 'A' + 1;
            cout << code;
        }
    }
}

ARM โœ…
n = int(input())
a = [list(map(int, input().split())) for _ in range(n)]

for i in range(n):
    for j in range(n):
        x = a[i][j]
        while x % 5 != 0:
            x -= 1
        print(x, end=" ")
    print()

ARM โœ…
๐Ÿ“ŒURJENT REQUIRMENT
Position: Machine Learning Engineer


Experience: 1 year
Location: Noida, Sector 63 (Onsite)
Salary: โ‚น20-30k/month

We're looking for a passionate ML Engineer with 1 year of experience to join our team. If you're skilled in ML, MLE, NLP, and LLM, weโ€™d love to hear from you!

Please send your resume to binni@juppiterailabs.com
https://www.linkedin.com/posts/reenu-s_insuretech-entrylevel-careeropportunity-activity-7231913037518020608-THM1?utm_source=share&utm_medium=member_desktop

#Duck Creek is inviting applications for its first ever hashtag#Talent Acceleration Program (Cohort) for India. Share your CV at *reenu.sura@duckcreek.com* if you meet below eligibility criteria:
- Graduated in 2023/2024
- BTech/B.E. (Computer Science Engineering OR Information Technology) OR MTech/M.E. (Computer Science Engineering)
- CGPA of 7.5 or higher (equivalent to 70% or more)
- Understand object-oriented design and coding in Java or C# or .NET

If you have completed any Industry internship or bootcamp trainings - it will be a plus.

hashtag#Early Careers Job Opportunity hashtag#Freshers Hiring hashtag#Cohort
๐Ÿ‘1
#include <iostream>
#include <string>
using namespace std;
int ss(char c, char f) {
    if (f >= c) {
        return f - c;
    } else {
        return (f - c + 26) % 26;
    }
}
int main() {
    string C, F;
    int N;
    cin >> C >> F >> N;
    int len = C.length();
    int t = 0;
    int s = 0;
    for (int i = 0; i < len; i++) {
        t += ss(C[i], F[i]);
        s += (i + 1);
    }
    if (t <= s) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}


MAQ โœ…
๐Ÿ‘1
def getMergedIntervals(intervals):
    intervals.sort(key=lambda x: x[0])
    huihui = []

    for interval in intervals:
        if not huihui or huihui[-1][1] < interval[0]:
            huihui.append(interval)
        else:
            huihui[-1][1] = max(huihui[-1][1], interval[1])
           
    return huihui


Merge intervals โœ