Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
could I get some clarification please for why don't you care about skip same ele...

Jharol Rivera

May 19, 2022

could I get some clarification please for why don't you care about skip same element to avoid duplicate triplets as you did in Triplet Sum to Zero problem?

3

0

Comments
Comments
Design Gurus
Design Gurus3 years ago

In this problem, we don't need to skip the same element. There is no such requirement, hence, it is actually required to consider every element.

Don't confuse it with the following requirement though:

where i, j, and k are three different indices...

In this problem...

On this page

Problem Statement

Try it yourself