{-1,0,2,3) target = 3
why is the answer 2? should’nt it be 5? The question states not to re-use the same index in a single combo. The same index can be re-used in different combos, rite? which of the follow combos are invalid answers?
possible combos are
-1,0,2 < 3
-1,0,3 <3
-1,2,3
0,-1,2 <3
0,2,3
2,-1,0 <3
2,0,3
3,-1,0 <3
3,0,2
Course: Grokking the Coding Interview: Patterns for Coding Questions - Learn Interactively
Lesson: Triplets with Smaller Sum (medium) - Grokking the Coding Interview: Patterns for Coding Questions