NeetCode #826LC-3068HardGreedy
← Back to All Problems

#826 · #3068 · Find the Maximum Sum of Node Values(最大节点价值之和)

📌 Problem Statement & Constraints

You are given a tree with n nodes, an array nums of node values, an integer k, and edges describing the tree. In one operation, choose an edge and replace both endpoint values with their XOR by k. Maximise the sum of all node values. Constraints: 2 <= n <= 2 * 10^4, 1 <= nums[i], k <= 10^9.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!