๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.62K 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
๐Ÿ“ŒLepide  is Hiring QA Freshers
Location: Noida! ๐Ÿš€

Are you a talented QA looking to take your career to the next level?

If youโ€™re passionate about QA and ready to make an impact

Send your resume to
nisha.rajput@lepide.com
ayushi.sharma@lepide.com
SELECT
  c.name AS name,
  COUNT(w.customer_id) AS warehouses,
  MIN(w.volume) AS min_volume,
  MAX(w.volume) AS max_volume,
  SUM(w.volume) AS total_volume
FROM
  customers c
INNER JOIN
  warehouses w ON c.id = w.customer_id
WHERE
  w.is_active = 1
GROUP BY
  c.name
ORDER BY
  c.name ASC;

IBM โœ…
def getBitDistances(n):
    binary = bin(n)[2:]
    return max(len(binary) - 1 - i for i, bit in enumerate(binary) if bit == '1')

def getTopKBitDistances(numbers, k):
    bit_distances = [(num, getBitDistances(num)) for num in numbers]
    sorted_numbers = sorted(bit_distances, key=lambda x: (-x[1], -x[0]))
    return [num for num, _ in sorted_numbers[:k]]


IBMโœ…
class Solution {
    public int solution(int[][] peanuts, int[][] carrots) {
        int N = peanuts.length;
        int M = peanuts[0].length;

        int[][] dp = new int[N][M];

        dp[0][0] = peanuts[0][0] - carrots[0][0];

        for (int j = 1; j < M; j++) {
            dp[0][j] = dp[0][j - 1] + peanuts[0][j] - carrots[0][j];
        }

        for (int i = 1; i < N; i++) {
            dp[i][0] = dp[i - 1][0] + peanuts[i][0] - carrots[i][0];
        }

        for (int i = 1; i < N; i++) {
            for (int j = 1; j < M; j++) {
                dp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]) + peanuts[i][j] - carrots[i][j];
            }
        }

        return dp[N - 1][M - 1];
    }

Atlan fellowship โœ…
๐Ÿ‘1
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <bits/stdc++.h>
using namespace std;
#define int long long

int quadruple(vector<int> arr, int n) {
    int ans = 0;
    vector<int> left(n), right(n);
    left[0] = 0;
    right[n - 1] = 0;
    for (int i = 1; i < n; i++) {
        left[i] = 0;
        for (int j = 0; j < i; j++) {
            if (arr[j] < arr[i]) {
                left[i]++;
            }
        }
    }
    for (int i = n - 2; i >= 0; i--) {
        right[i] = 0;
        for (int j = n - 1; j > i; j--) {
            if (arr[j] > arr[i]) {
                right[i]++;
            }
        }
    }
    for (int i = 1; i < n - 1; i++) {
        for (int j = i + 1; j < n - 1; j++) {
            ans += left[i] * right[j];
        }
    }
    return ans;
}

int32_t main() {
   int t;
    cin >> t;
    while(t--){
         int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    int ans = quadruple(a, n);
    cout << ans << endl;
    }



}

DB โœ…
ll solve(vector<ll>& ar,bool f) {
    ll n=ar.size();
    ll s=*min_element(ar.begin(), ar.end());
    ll l=*max_element(ar.begin(), ar.end());
    vector<ll>dp(l-s+1);
    for(ll j=0;j<dp.size();j++)
    {
        if (f) dp[j]=abs(ar[0]-(s+j));
        else dp[j]=abs(ar[0]-(l - j));
    }
    for (ll i=1;i<n;i++) {
        ll m=LONG_MAX;
        vector<ll>c(dp.size());
        for (ll j=0;j<dp.size();j++)
        {
            m=min(m,dp[j]);
            if(f) c[j]=m+abs(ar[i]-(s+j));
            else  c[j]=m+abs(ar[i]-(l-j));
        }
        dp=c;
    }
    ll a=LONG_MAX;
    for (ll j=0;j<dp.size();j++) a=min(a,dp[j]);
    return a;
}
ll helper(vector<ll>&a)
{
    return min(solve(a,1),solve(a,0));
}

Modify an Array โœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
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