es
Feedback

¡No caigas en manos de tramposos! Telemetrio encuentra y marca estos canales 👉 Si quieres ver la etiqueta, suscríbete

ATS resume help

ATS resume help

Ir al canal en Telegram

WhatsApp Me https://wa.me/917674087200 ✅ ATS-Friendly Resumes ✅ Higher Interview Calls ✅ Free Tips + Templates

Mostrar más
3 723
Suscriptores
-524 horas
-217 días
-5230 días
Archivo de publicaciones
Q3 code in c++👆

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<

Want codes in c++ also? Pls make 3.4k here @Coding_Palace Still 20 members left

Done q3 in c++✅

photo content

Want codes in c++ also? Pls reply here @Coding_Palace1

Q3👆 Cut the edge code✅

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

Q3 in text format👆

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

Share our channel❤️ -->@Coding_Palace Make 30 more subscribers I will send q3 also in text format ✅

How many meets code Python

class Solution: def findGCD(self, a, b ): if b

Minimum waiting time code 👆

class Solution: def isPossible(self, n, m, c, arr, maxWaitingTime): firstStudentArrivalTime = -(maxWaitingTime + 1) studentsOnboarded = 0 bussNeeded = 0 for time in arr: if time - firstStudentArrivalTime > maxWaitingTime or studentsOnboarded > c: bussNeeded +=1 firstStudentArrivalTime = time studentOnboarded = 0 studentOnboarded += 1 return bussNeeded <= m def minimumWaitTime(self, n , m, c, arr): arr.sort() low, high=0, arr[-1] - arr[0] ans=high while low <= high: mid= low + (high-low)//2 if self.isPossible(n,m,c,arr,mid): ans=mid high=mid-1 else: low=mid+1 return ans

Share our channel❤️ -->@Coding_Palace Make 30 more subscribers I will send codes in text format also✅

Share our channel @Coding_Palace Make 30 more subscribers I will send codes in text format also✅

Doing in c++ Will come soon
Doing in c++ Will come soon

Cut the edge code 👆

photo content