What is the main signal for Two Pointers: Pair, Triplet and Water Problems?
Practice this question from Quiz: Two Pointers: Pair, Triplet and Water Problems, with options and an explanation.
Question
What is the main signal for Two Pointers: Pair, Triplet and Water Problems?
Option A — Correct answer
You need a pair, triplet, closest sum, deduped combination, or max width score from an array.
Option B
The input has no constraints.
Option C
The sample output is small.
Option D
The question uses only one variable.
Explanation
Pattern choice starts from constraints and invariant.