Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/amos-kibet/data-structures


https://github.com/amos-kibet/data-structures

Last synced: 5 days ago
JSON representation

Awesome Lists containing this project

README

        

# Data-Structures Blogpost on Decoded Africa
## Below is a description of the challenge:
* Given an array of integers that is already sorted in ascending order,
* find two numbers such that they add up to a specific target number
* (there is no guarantee that the 2 numbers exist) e.g.
* Input: numbers = [2,7,11,15], target = 9
* Output: [2,7] because 2 and 7 adds up to 9
* (we are supposed to return an array of size 2 containing the numbers).
* We can use a two-pointer approach as shown in the code above: