Problem: Find if an array contains duplicate values. Given {3, 1, 4, 1, 5}, detect that 1 appears twice. Report whether duplicates exist, or identify which values repeat. Approach with nested loops: compare every pair.
Outer loop picks element i, inner checks all j where j > i. If arr[i] == arr[j], you found a duplicate. Simple but O(n²). For large arrays, O(n²) is slow. Better approaches use sorting (O(n log n)) or hash sets (O(n)).
But nested loops work and demonstrate the core comparison pattern.