Coding | EXAMS | IBM ACCENTURE | VIRTUSA | IBM | AMAZON | TCS | EPAM | WILEY EDGE | TECH MAHINDRA | JPMORGAN | HCL | WIPRO
3.37K subscribers
1.13K photos
3 videos
17 files
373 links
Main channel https://t.me/Coding_000
Contact Admin 👉 @ILOVEU_143 for booking your exam slots
Web- https://coding000.github.io/Projects/
💯% clearance in any placement exams
OffCampus -https://t.me/Offcampus_000
Discussion- https://t.me/exams_discussion
Download Telegram
Company Name:  Deloitte
Post Name:  Junior Engineer/ Business Analyst
Salary:  Best In Industry
Degree:  B.E/B.Tech/BCA/ME/M.Tech/MCA/MBA
Batch:  2018/2019/2020/2021/2022/2023
Experience:  Freshers/Experienced
Job Location:  Pan India

Apply Link:
Junior Engineer:
https://usijobs.deloitte.com/careersUSI/JobDetail/USI-R-FA-EH-Junior-Chronicle-Engineer-SA/143201

Analyst:
https://usijobs.deloitte.com/careersUSI/JobDetail/USI-EH24-MF-ITS-CA-Off-Campus-Analyst/147196

Join Offcampus_000
👍2
How many of you are having

CODEKAZE Today

Hit Like 👍 Button
For free answers🆓
👍16
Any one want projects -mini or Major 😊  Unique project💥💥
Domain AI/ML
contact -@ILOVEU_143 ❤️

Anyone need help in GRE and TOFEL, GMAT, DUOLINGO Exam help 👨‍💻👨‍💻

SOP , LOR📝

Note -paid 🤑

share share @Coding_000
👍2
Any  campus placement or Offcampus Exam.

Help available in All exams.

Book your slot.👨‍💻

Contact @IHATEU_183 ❤️

Its paid
100% clearance guarantee 🔥🔥
Share @Coding_000 ❤️
👍1
Hello everyone mostly all codes available

Only msg me if u want paid help.

Contact @IHATEU_183👨‍💻
Directed Soldier


int directedSoldiers(int n, vector<int> &a) {
    // Write your code here.
    int d=0;
    vector<int> p, p1;
    vector<int> b = a;
    reverse(b.begin(), b.end());
    int k=0;
    for (int i = 0; i < n; i++) {
        if (b[i]==0) {
            k++;
        }
        p1.push_back(k);
    }
    for (int i = 0; i < n; i++) {
        if (a[i] == 1) {
            d += 1;
        }
        p.push_back(d);
    }
    reverse(p1.begin(), p1.end());
    p1.push_back(0);
    int res = count(a.begin(), a.end(), 0);
    for (int i = 0; i < n; i++) {
        int x = p[i] + p1[i + 1];
        res = min(res, x);
    }
    return res;
    
}
👍3
int terminalDefence(int n, int m, const vector<int>& a, const vector<int>& h, const vector<int>& b, int k) {
    vector<pair<int, int>> monsters;
    for (int i = 0; i < m; i++) {
        monsters.push_back({a[i], h[i]});
    }
    sort(monsters.begin(), monsters.end());

    for (int i = 0; i < n; i++) {
        int sentinelPos = b[i];
        auto it = lower_bound(monsters.begin(), monsters.end(), make_pair(sentinelPos, 0));

        if (it == monsters.end())
            return 0;

        int monsterPos = it->first;
        int monsterHealth = it->second;
        if (monsterPos == sentinelPos) {
            if (monsterHealth <= k)
                monsters.erase(it);
            else
                it->second -= k;
        } else {
            if (it == monsters.begin())
                return 0;

            it--;
            monsterPos = it->first;
            monsterHealth = it->second;
            if (monsterHealth <= k)
                monsters.erase(it);
            else
                it->second -= k;
        }
    }

    return monsters.empty() ? 1 : 0;
}
👍2
def calculate_xor(nums):
    xor_val = 0
    for num in nums:
        xor_val ^= num
    return xor_val


def maximum_beauty(A, D, N, M):
    blocks = {}
    parent = list(range(N))
    rank = [1] * N
    beauty = []

    for i in range(N):
        blocks[i] = [A[i]]

    def find_parent(x):
        if parent[x] != x:
            parent[x] = find_parent(parent[x])
        return parent[x]

    def merge_blocks(x, y):
        px = find_parent(x)
        py = find_parent(y)
        if px == py:
            return

        if rank[px] > rank[py]:
            parent[py] = px
            blocks[px].extend(blocks[py])
            rank[px] += rank[py]
        else:
            parent[px] = py
            blocks[py].extend(blocks[px])
            rank[py] += rank[px]

    for i in range(M):
        obj1 = i * 2
        obj2 = i * 2 + 1
        merge_blocks(obj1, obj2)

    for decay_obj in D:
        beauty.append(calculate_xor(blocks[find_parent(decay_obj)]))

        parent_block = find_parent(decay_obj)
        parent_block_objs = blocks[parent_block]
        parent_block_objs.remove(A[decay_obj])

        if not parent_block_objs:
            del blocks[parent_block]

    return beauty


N = int(input("Enter the number of objects (N): "))
M = int(input("Enter the number of object links (M): "))

print("Enter the values of the objects:")
A = [int(input()) for _ in range(N)]

K = int(input("Enter the order of object decay (K): "))

print("Enter the indices of the objects in the order of decay:")
D = [int(input()) for _ in range(K)]

result = maximum_beauty(A, D, N, M)

print("Maximum beauty of blocks before object decay:", *result)


building block
👍1
long long superMovement(int n, vector<int> &a, int k) {
    // Write your code here.
    vector<long long> v(k - 1, LLONG_MAX);  // Use LLONG_MAX for long long
    long long ans = 0;
    int j = 0;

    for (int i = 0; i < n - 1; i++) {
        if (j == k - 1) {
            j = 0;
            continue;
        }

        long long x = abs(a[i] - a[i + 1]);
        v[j] = min(v[j], x);
        j++;
    }

    for (auto i : v) {
        ans += i;
    }

    return ans;
}
👍2
*Fighting traffic code!!*

int getTotalFun(int n, int m, const vector<vector<int>>& graph, const vector<int>& f, int tolerance) {
    vector<int> visited(n, 0);
    int totalFun = 0;
    queue<int> q;
    q.push(0);
    visited[0] = 1;

    while (!q.empty()) {
        int city = q.front();
        q.pop();
        totalFun |= f[city];

        for (int neighbor : graph[city]) {
            if (visited[neighbor] == 0 && tolerance >= 0) {
                q.push(neighbor);
                visited[neighbor] = 1;
            }
        }
    }

    return totalFun;
}
int fightingTraffic(int n, int m, vector<vector<int>> &roads, vector<int> &t, vector<int> &f, int x) {
    // Write your code here.
        int low = 0; // Minimum traffic tolerance
    int high = 1e9; // Maximum traffic tolerance
    int result = -1;

    while (low <= high) {
        int mid = low + (high - low) / 2;
        vector<vector<int>> graph(n);

        for (int i = 0; i < m; i++) {
            int city1 = roads[i][0];
            int city2 = roads[i][1];
            int traffic = t[i];

            if (traffic <= mid) {
                graph[city1].push_back(city2);
                graph[city2].push_back(city1);
            }
        }

        int totalFun = getTotalFun(n, m, graph, f, mid);
        if (totalFun >= x) {
            result = mid;
            high = mid - 1;
        } else {
            low = mid + 1;
        }
    }

    return result;
}
👍4