N

如何在数组中找出三个数之和为 N

排序之后使用双指针 let ar = [5, 12, 6, 3, 9, 2, 1, 7]; function getthreenum(arr, target, result = []) { arr = arr.sort((a, b) ...