Tag view

#sorting

Cross-subject tag search for related interview cards.

Clear

Results update as you type. Press / to jump straight into search.

Tagged with sorting

2 cards

Coding Exercises Medium O(n^2)

3 Sum

Sort the array, fix one value at a time, and use two pointers on the remaining range. Skip duplicate anchors and duplicate pointer values so the result contains unique triplets only.

Return all unique triplets in an array whose sum is zero.

Coding Exercises Medium O(n log n)

Merge Intervals

Sort intervals by start, then compare each interval with the current merged tail. Extend the tail end when ranges overlap; otherwise append a new interval.

Merge all overlapping intervals and return the condensed list.