К
Size: a a a
К
L
К
К
К
L
function treeSum(a) {
let sum = 0
try {
a = [...a]
for(const v of a)
sum += typeof v === "number" && !isNaN(v) && (v + 1 !== v) ? v : treeSum(v)
} catch(e) {}
return sum
}
К
S
К
S
S
S
S
function treeSum(a) {
let sum = 0
try {
a = [...a]
for(const v of a)
sum += typeof v === "number" && !isNaN(v) && (v + 1 !== v) ? v : treeSum(v)
} catch(e) {}
return sum
}
S
S
L