Finding the Sum up array having numbers sum[1,n] = n*(n+1)/2 110 (binary) to (int) val = val*2 + node.val at last ans = 6