Untitled
unknown
plain_text
22 days ago
448 B
1
Indexable
Never
arr1 = [] arr2 = [] for (let i = 0; i < 9; i++) { arr1.push([Math.floor(Math.random()*25), i]) arr2.push([Math.floor(Math.random()*25), i]) } arr = [] for (let i = 0; i < 9; i++) { arr.push([Math.floor((arr1[i][0] - arr2[i][0]) / 2), i]) } arr.sort((a, b) => a[0] - b[0]) console.log(arr1) console.log(arr2) console.log(arr) let lPointer = 0; let rPointer = arr.length - 1; while (arr[lPointer] < 0 && arr[rPointer] > 0) { }
Leave a Comment