/* 暴力破解法 */
function twoSum(array, target) {
for (let index1 = 0; index1 < array.length; index1++) {
let number = target - array[index1];
let index2 = array.indexOf(number);
if (index2 !== -1 && index2 !== index1) {
return [index1, index2]
};
}
return [];
}
const array = [2, 3, 5, 7, 9, 11, 13];
const target = 10;
const result = twoSum(array, target);
console.log(result);