allcoding1_official
106K subscribers
766 photos
2 videos
73 files
762 links
Download Telegram
This media is not supported in your browser
VIEW IN TELEGRAM
How many pairs of letters are there in the word "DYNASTY" which has as many letters between them (from both the sides) as in the alphabets from A to Z?

A) 2

@allcoding1_official
In MS Word, how can a document be split into multiple parts such that each part can have different formats and layouts

Ans)By creating sections

@allcoding1_official
Which of the statement(s) given below is/are correct?


1)Routers can be static or dynamic
2)Routers connect two or more separate networks,

Ans) both 1 and 2

@allcoding1_official
X(1), (2)

int count;

// Line 1



Antint i) { count 1)



int getcount () {return count)

// Line 5



public class Book


public static void main(String[] args)


System.out.println(AB.X.count + AB.Y.count); // Line 10


Ans)Compile time error at "// Line 10"

@allcoding1_official
👍2
allcoding1_official
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_official
👍4
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_official
👍2
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_official
👍1
if not intervals:
        return 0
   
    intervals.sort(key=lambda x: x[0])  # Sort intervals based on start points
    merged_intervals = [intervals[0]]  # Initialize merged intervals with the first interval
   
    for interval in intervals[1:]:
        prev_interval = merged_intervals[-1]
       
        if interval[0] <= prev_interval[1]:  # If overlapping with previous interval
            prev_interval[1] = max(prev_interval[1], interval[1])  # Merge intervals
        else:
            merged_intervals.append(interval)  # Add non-overlapping interval
   
    total_length = sum(end - start for start, end in merged_intervals)
    return total_length

# Example usage:
intervals = [(1, 3), (2, 6), (8, 10), (15, 18)]
total_length_covered = merge_intervals(intervals)
print("Total length covered after merging overlapping intervals:", total_length_covered)
👍5
Forwarded from allcoding1_official
🎯Atos Is Hiring

Degree:- Any Graduate
Batch:- 2019, 2020, 2021, 2022, 2023 & 2024

Apply Now:- https://www.allcoding1.com/2024/02/atos-off-campus-drive-for-any-graduate.html


Telegram:- @allcoding1_official
👍1
Forwarded from allcoding1_official
🎯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_official
Forwarded from allcoding1_official
🎯 Microsoft Bulk Hiring 2024 | For Software Engineer

Degree:- BE, B Tech, BA, B COM, BBA, BSC, BCA, ME, M Tech, MCA, MA, M COM, MSC, Any Graduate
Batch:- 2018, 2019, 2020, 2021, 2022, 2023 ,2024 & 2025

Apply now:- https://www.allcoding1.com/2024/02/microsoft-bulk-hiring-2024-for-software.html

Telegram:- @allcoding1_official
1
Forwarded from allcoding1_official
🎯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_official
1👍1