Skip to content

Instantly share code, notes, and snippets.

# DSA Question Bank
## Arrays, Hashing, Prefix/Suffix
1. Find the second largest element in one pass without extra space.
2. Find the k largest distinct elements without fully sorting the array.
3. Find the two numbers that appear once when every other number appears twice.
4. Find the majority element that appears more than n / 2 times.
5. Find all elements that appear more than n / 3 times.
6. Count inversions in an array.