fa
Feedback
Coding | EXAMS | IBM ACCENTURE | VIRTUSA | IBM | AMAZON | TCS | EPAM | WILEY EDGE | TECH MAHINDRA | JPMORGAN | HCL | WIPRO

Coding | EXAMS | IBM ACCENTURE | VIRTUSA | IBM | AMAZON | TCS | EPAM | WILEY EDGE | TECH MAHINDRA | JPMORGAN | HCL | WIPRO

رفتن به کانال در Telegram

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

نمایش بیشتر
3 350
مشترکین
-124 ساعت
-147 روز
-4730 روز
آرشیو پست ها
class Solution {     public static int maxSum(int A, int B, int C) {         int M = 0, xor = 0, i = 31;         M=Math.max(A,Math.max(B, C));                 for(;i>=0 && (M&(1<=0;i--) {             if(calc(A, B, C, i)<=1) {                 xor |= 1<0 ? 1 : 0;         int b = (B&(1<0 ? 1 : 0;         int c = (C&(1<0 ? 1 : 0;         int t = a+b+c;         return t;     } }

class Solution {     static List<Integer> tree[];     static long solve(int n, int Par[]) {         tree = new ArrayList[n+1];         for(int i=0;i<=n;i++) tree[i] = new ArrayList<>();         for(int i=1;i<n;i++) {             int u=i+1, v=Par[i];             tree[u].add(v);             tree[v].add(u);         }         return dfs(1, 0);     }     public static int dfs(int cur, int par) {         int sum = 0;         for(int child: tree[cur]) {             if(child==par) continue;                         sum += dfs(child, cur);         }         return Math.max(sum, cur);     } } Join here :@Coding_000

class Node:     def init(self, val):         self.val = val         self.childs = [] class Solution:     def dfs(self, root):         ans = 0         for child in root.childs:             ans += self.dfs(child)         root.val += ans         if root.val < 0:             ans += -root.val         return ans              def solve(self, n, P):         nodes = {}         for i in range(1, n+1):             nodes[i] = Node(-i)         for i in range(1, n):             child, parent = nodes[i+1], nodes[P[i]]             parent.childs.append(child)         return self.dfs(nodes[1]) Non negative tree

Bots on social media ,three numbers, non negative tree Coding solutions given to u just share our channel fast ✅😊👍 share ✅ share ✅

Bots on social media ,three numbers, non negative tree Coding solutions given to u just share our channel fast ✅😊👍