ATS resume help
Kanalga Telegram’da o‘tish
WhatsApp Me https://wa.me/917674087200 ✅ ATS-Friendly Resumes ✅ Higher Interview Calls ✅ Free Tips + Templates
Ko'proq ko'rsatish3 721
Obunachilar
-224 soatlar
-197 kun
-5430 kun
Postlar arxiv
3 721
Book your slots for
🏮Mitsogo✅
🏮GCP certification✅
🏮AWS Certification✅
Or for any other exam
Contact @PlacementsBro😎
Note: it's paid help🎀
100 percent Clearance✅
We help for all Kinds of Exams Helps-- @Coding_Palace1❤️🔥
3 721
long long num=0;
long long cost_node=0;
vis[node]=1;
for(auto a:adj[node]){
if(vis[a]==-1){
// cost++;
dfs(a,adj,child,vis,cost);
// cost--;
cost_node+=cost[a]+child[a];
num+=child[a];
}
}
// if(num==0)
// child[node]=1;
// else
child[node]=num+1;
cost[node]=cost_node;
}
long long minDistance(int n, vector> &edges) {
// code here
if(n==1)
return 0;
vectoradj[n];
for(auto a:edges){
adj[a[0]].push_back(a[1]);
adj[a[1]].push_back(a[0]);
}
vectorvisit(n,-1);
vectorchild(n,0);
vectorcost(n,0);
long long costt=0;
dfs(0,adj,child,visit,cost);
// for(int i=0;iq;
q.push(0);
int deep=0;
vectorvis(n,-1);
long long less=cost[0];
while(q.size()>0){
int l=q.size();
for(int i=0;i=1){
less=min(less,(cost[0]-(deep*(child[a]))));
}
q.push(a);
}
}
}
deep++;
}
// cout<
3 721
class Solution:
def findPathSum(self , tree, node, vis, pathSum):
childPathSum =0;
vis[node] = True;
for nbr in tree[node]:
if nbr not in vis:
childPathSum += self.findPathSum(tree,nbr,vis,pathSum +1)
return childPathSum + pathSum
def helper(self,tree,node,vis,pathSum,anss):
childs =1
vis[node]=True;
for nbr in tree[node]:
if nbr not in vis:
childs += self.helper(tree,nbr,vis,pathSum+1,anss)
anss[0] = max(anss[0],(pathSum -1)*childs)
return childs;
def minDistance(self, n, adj):
tree = adj
maxi = self.findPathSum(tree,0,{},0)
ans = maxi
for nbr in tree[0]:
anss = [float("-inf")]
deductionPossible = self.helper(tree,nbr,{0:True},1,anss)
ans = min(ans,maxi-anss[0])
return ans
3 721
class Solution:
def findPathSum(self , tree, node, vis, pathSum):
childPathSum =0;
vis[node] = True;
for nbr in tree[node]:
if nbr not in vis:
childPathSum += self.findPathSum(tree,nbr,vis,pathSum +1)
return childPathSum + pathSum
def helper(self,tree,node,vis,pathSum,anss):
childs =1
vis[node]=True;
for nbr in tree[node]:
if nbr not in vis:
childs += self.helper(tree,nbr,vis,pathSum+1,anss)
anss[0] = max(anss[0],(pathSum -1)*childs)
return childs;
def minDistance(self, n, adj):
tree = adj
maxi = self.findPathSum(tree,0,{},0)
ans = maxi
for nbr in tree[0]:
anss = [float("-inf")]
deductionPossible = self.helper(tree,nbr,{0:True},1,anss)
ans = min(ans,maxi-anss[0])
return ans
3 721
Share our channel❤️
-->@Coding_Palace
Make 30 more subscribers
I will send q3 also in text format ✅
