Showing 3 questions
Implement a circular queue data structure with a fixed size. You'll need to handle enqueueing, dequeueing, and checking if the queue is full or empty efficiently.
#1. Design Circular Queue
Find all unique triplets in an array that sum to zero. You'll need to consider the potential for duplicate numbers and avoid duplicate triplets in your solution.
#2. 3Sum
Find all unique quadruplets in an array that sum to a target value. You'll need to efficiently search for combinations of four numbers that satisfy the given condition.
#3. 4Sum