Question bank › Two Pointers
Dsa Two Pointers Hard

Find Duplicate Triples

You are given an array of integers. Your task is to find all unique triples (i, j, k) where i < j < k and the values at those indices are equal. Implement a function that reads from standard input and outputs these unique triples in lexicographical order. Example: Input: 6 1 2 1 3 1 2 Output: (0, 2, 4) (1, 5, 3) Input Description: The first line contains a single integer n (3 ≤ n ≤ 100). The second line contains n space-separated integers.

Key concepts

two_pointerscombinationsduplicates

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.