---
title: "Discussion on \"Two Sum II - Input Array Is Sorted Using Two Pointers\" | Hashnode"
description: "Discussion on \"Two Sum II - Input Array Is Sorted Using Two Pointers\". var twoSum = function (numbers, target) {\n    let [start, end] = [0, numbers.length - 1];\n    while (start < end) {\n        const currentSum = numbers[start] + numbers[end];\n        const isTarget = currentSum === target;\n        if (isTarget) {\n    ..."
url: "https://hashnode.com/posts/two-sum-ii-input-array-is-sorted-using-two-pointers/6594cdb20589b45107013593"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Two Sum II - Input Array Is Sorted Using Two Pointers](https://suryasun.hashnode.dev/two-sum-ii-input-array-is-sorted-using-two-pointers?utm_source=hashnode&utm_medium=feed)

var 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) { ...

Jan 3, 2024 · 1 min read · suryasun.hashnode.dev  
Read the article

-   [#two-pointers](https://hashnode.com/tag/two-pointers)
-   [#array](https://hashnode.com/tag/array)
-   [#js](https://hashnode.com/tag/js)
-   [#data-structures](https://hashnode.com/tag/data-structures)
-   [#algorithms](https://hashnode.com/tag/algorithms)

## Written by

[Surya](https://hashnode.com/@surya009)

@surya009 · India

  
[View profile](https://hashnode.com/@surya009)

Full stack developer @Domaincer

## Responses

Comments are turned off for this post.
