Finding duplicate elements in 2d arrays?(javascript) via /r/learnprogramming


Finding duplicate elements in 2d arrays?(javascript)

Right now, i have a 2d array with numbers that are sorted.

ie:

1:{100,200}

2:{200,300}

3:{400,500}

is there a way to find that indicies 1 and 2 have a duplicated element, that is faster than simply iterating over every single element?

Submitted July 17, 2017 at 11:32PM by pineapplereduxx
via reddit http://ift.tt/2u3mpB7

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s