We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0740b60 commit 3214001Copy full SHA for 3214001
src/main/java/g3001_3100/s3068_find_the_maximum_sum_of_node_values/Solution.java
@@ -4,11 +4,11 @@
4
// #2024_03_31_Time_1_ms_(100.00%)_Space_54.5_MB_(67.07%)
5
6
public class Solution {
7
- public long maximumValueSum(int[] A, int k, int[][] edges) {
+ public long maximumValueSum(int[] nums, int k, int[][] edges) {
8
long res = 0;
9
int d = 1 << 30;
10
int c = 0;
11
- for (int a : A) {
+ for (int a : nums) {
12
int b = a ^ k;
13
res += Math.max(a, b);
14
c ^= a < b ? 1 : 0;
0 commit comments