Suryasuryasun.hashnode.dev·Jan 3, 2024Two Sum II - Input Array Is Sorted Using Two Pointersvar twoSum = function (numbers, target) { let [start, end] = [0, numbers.length - 1]; while (start < end) { const currentSum = numbers[start] + numbers[end]; const isTarget = currentSum === target; if (isTarget) { ...10 likes·30 readsDSA in JStwo pointersComments disabledThe comments have been disabled by the author for this article.