## Question

Have the function ArrayAdditionI(arr) take the array of numbers stored in arr and return the string true if any combination of numbers in the array (excluding the largest number) can be added up to equal the largest number in the array, otherwise return the string false. For example: if arr contains `[4, 6, 23, 10, 1, 3]` the output should return true because `4 + 6 + 10 + 3 = 23`. The array will not be empty, will not contain all the same elements, and may contain negative numbers.

Use the Parameter Testing feature in the box below to test your code with different arguments.

```.css-e69dqy{position:relative;z-index:0;}.css-qq5p7o{padding:var(--chakra-space-5);border-radius:8px;margin-top:var(--chakra-space-8);margin-bottom:var(--chakra-space-8);background:#011627;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;overflow:hidden;}function ArrayAddition(arr) {
let maxValue = 0;
for (let el of arr) {
if (el > maxValue) {
maxValue = el;
}
}

const [maxElement] = arr.splice(arr.indexOf(maxValue), 1);
const combos = [];
// use a binary string representation to set the permutations
for (let i = 0, max = Math.pow(2, arr.length); i < max; i++) {
let binaryRepresentation = i.toString(2);
while (binaryRepresentation.length < arr.length) {
binaryRepresentation = '0' + binaryRepresentation;
}
combos.push(binaryRepresentation);
}

for (let permutation of combos) {
let sum = 0;
for (let i = 0; i < permutation.length; i++) {
if (permutation[i] === '1') {
sum += arr[i];
}
}

if (sum === maxElement) {
return true;
}
}

// code goes here
return false;