allcoding1
27.7K subscribers
2.2K photos
2 videos
77 files
852 links
Download Telegram
🎯Tech Mahindra Off Campus drive

Job Role Associate Software Engineer
Qualification B.E/B.Tech/MCA/M.Sc
Experience Freshers
Batch 2022/2023
Salary Rs.3.25 LPA & 5.5LPA (for super coders)
Job Location Across India
Venue Location Virtual(Online)
Last Date 4 February 2024

Apply now:- https://www.allcoding1.com/2024/02/tech-mahindra-off-campus-drive-2024.html?m=1

Telegram:- @allcoding1
πŸ‘4
26) D
27) C
28)A

@allcoding1
#include <bits/stdc++.h>
using namespace std;

int getMinimumMoves(string word) {
    unordered_map<char, int> freq;
    int moves = 0;

    for (char c : word) {
        freq[c]++;
    }

    for (auto& entry : freq) {
        moves += entry.second / 2;
    }

    return moves;
}

Minimum length word βœ…

Telegram:- @allcoding1
#include <iostream>
#include <vector>
#include <unordered_map>
#include <sstream>

using namespace std;

vector<string> computeParameterValue(vector<vector<string>>& sources) {
    unordered_map<string, string> final_parameters;
    vector<string> order_of_keys;

    for (auto& source : sources) {
        for (auto& pair : source) {
            stringstream ss(pair);
            string key, value;
            getline(ss, key, ':');
            getline(ss, value, ':');

            if (final_parameters.find(key) == final_parameters.end()) {
                order_of_keys.push_back(key);
            }
            final_parameters[key] = value;
        }
    }

    vector<string> final_parameters_list;
    for (auto& key : order_of_keys) {
        final_parameters_list.push_back(final_parameters[key]);
    }

    return final_parameters_list;
}

Stock Analysis βœ…

Telegram:- @allcoding1
πŸ‘2
static int getAnagramPeriod(String input_str) {
        int n = input_str.length();
       
        for (int period = 1; period <= n; period++) {
            if (n % period == 0) {
                String subString = input_str.substring(0, period);
                boolean valid = true;

                for (int i = 0; i < n; i += period) {
                    if (!isAnagram(subString, input_str.substring(i, i + period))) {
                        valid = false;
                        break;
                    }
                }

                if (valid) {
                    return period;
                }
            }
        }

        return -1;
    }

    static boolean isAnagram(String str1, String str2) {
        char[] charArray1 = str1.toCharArray();
        char[] charArray2 = str2.toCharArray();
        Arrays.sort(charArray1);
        Arrays.sort(charArray2);
        return Arrays.equals(charArray1, charArray2);
    }

Anagram Period βœ…

Telegram:- @allcoding1
int solve(int N, vector<int> A, int T) {
    int xa = 0;
    for(int i=0; i<N; i++) {
        xa ^= A[i];
    }
    int d = xa ^ T;
    if(d == 0) return 0;
    int ops = 0;
    while(d > 0) {
        ops += d & 1;
        d >>= 1;
    }
    return ops;
}

Flip or flop βœ…

Telegram:- @allcoding1
🎯EY is hiring for Data and Analytics

Expected Salary: 5-10 LPA

πŸ”—Apply here: https://eyglobal.yello.co/jobs/Zz403Fi4A5JV05N-0NtWSQ?job_board_id=c1riT--B2O-KySgYWsZO1Q
🎯Amazon Off Campus Hiring 2024 : Recruitment for Freshers | Register Now

Eligibility:
Testing Associate, Device OS:
Bachelor’s degree
Knowledge of QA methodology and tools
Preferred:
B.E,B.Tech. , MSC IT and MCA
Good Communication
Testing Knowledge

Apply:- https://www.allcoding1.com/2024/02/amazon-off-campus-hiring-2024.html


Telegram:- @allcoding1
πŸ‘2
int n=sc.nextInt(),i;
            int a[]=new int[n];
            for(i=0;i<n;i++) a[i]=sc.nextInt();
            int dp[]=new int[n];
        dp[0]=a[0];
        if(n>1)
            dp[1]=Math.max(a[0],a[1]);
        if(n>2)
            dp[2]=Math.max(a[0]+a[2],a[1]);
            for( i=3;i<n;i++)
                dp[i]=Math.max(a[i]+dp[i-2],dp[i-1]);
        System.out.println(dp[n-1]);

Special Sum βœ…
Intuit
πŸ‘1
Spreading Fire
Intuit βœ…
C
πŸ‘1
allcoding1
Photo
class TreeNode:
    def init(self, val):
        self.val = val
        self.children = []

def build_tree(units, relationships):
    nodes = {i: TreeNode(units[i]) for i in range(len(units))}
    for rel in relationships:
        parent, child = rel
        nodes[parent].children.append(nodes[child])
    return nodes[0] 

def max_electricity_per_floor(root):
    max_electricity = 0
    floor_electricity = {}
   
    def dfs(node, level):
        nonlocal max_electricity
        if level not in floor_electricity:
            floor_electricity[level] = 0
        floor_electricity[level] += node.val
        max_electricity = max(max_electricity, floor_electricity[level])
        for child in node.children:
            dfs(child, level + 1)
   
    dfs(root, 0)
    return max_electricity


num = int(input())
units = list(map(int, input().split()))
numRel, memConnect = map(int, input().split())
relationships = [tuple(map(int, input().split())) for _ in range(numRel)]


root = build_tree(units, relationships)


result = max_electricity_per_floor(root)
print(result)
Apartment one


@allcoding1
πŸ‘3❀1
int main() {
ll N;
cin >> N;

vector<ll> u(N);
for(ll i = 0; i < N; ++i) {
cin >> u[i];
}

ll M, X;
cin >> M >> X;

vector<vector<ll>> a(N);
for(ll i = 0; i < M; ++i) {
ll x, y;
cin >> x >> y;
a[x].push_back(y);
a[y].push_back(x);
}

vector<bool> v(N, false);
queue<ll> q;
q.push(0);
v[0] = true;

ll m = 0;
while(!q.empty()) {
ll s = q.size();
ll us = 0;
for(ll i = 0; i < s; ++i) {
ll n = q.front();
q.pop();
us += u[n];
for(ll nb : a[n]) {
if(!v[nb]) {
q.push(nb);
v[nb] = true;
}
}
}
m = max(m, us);
}

cout << m << endl;

return 0;
}



apartment

@allcoding1
πŸ‘1
int main() {
ll N;
cin >> N;

vector<ll> w(N);
for(ll i = 0; i < N; ++i) {
cin >> w[i];
}

vector<ll> s(N, 15);
for(ll i = N-2; i >= 0; --i) {
for(ll j = i+1; j < N; ++j) {
if(w[i] < w[j]) {
s[i] = 10;
for(ll k = j+1; k < N; ++k) {
if(w[j] > w[k]) {
s[i] = 5;
break;
}
}
break;
}
}
}

ll g = 0;
for(ll sc : s) {
g += sc;
}

cout << g << endl;

return 0;
}


chair manufacture

@allcoding1
πŸ‘4
Forwarded from allcoding1
🎯SAS Off Campus Drive 2024 – Associate Software Engineer – Freshers | Rs 4-8 LPA

Job Role : Associate Software Developer
Qualification : B.E/B/Tech/M.E. / M.Tech
Experience : Freshers
Job Location : Pune
Package : Rs 4-8 LPA

Apply Now:- https://www.allcoding1.com/2024/02/sas-off-campus-drive-2024-associate_9.html?m=1

Telegram:- @allcoding1