Grokking the Engineering Manager Coding Interview

0% completed

Introduction to Two Pointers Pattern

In problems where we deal with sorted arrays (or linked-lists) and need to find a set of elements that fulfill certain constraints, the Two Pointers approach becomes quite useful. The set of elements could be a pair, a triplet or even a subarray. For example, take a look at the following problem:

Given an array of sorted numbers and a target sum, find a pair in the array whose sum is equal to the given target.

.....

.....

.....

Like the course? Get enrolled and start learning!
Hajin Kim

Hajin Kim

· 2 years ago

It would be awesome if I could just write up notes on the side of each material so I can refer back to it

S

surbhi

· 4 years ago

Hello, Are there any patterns for solving String related questions?

Show 2 replies
M

Mohammad Awad

· 4 years ago

hi

Show 1 reply
Puneeth

Puneeth

· 6 days ago

Two pointers technique is useful whenever we have a set of elements let's say a pair, a triplet or even a subarray given we have a sorted array and we have to fulfil certain constraints.