3Sum - Complete Tutorial

Last Updated : 23 Jul, 2025

The 3-Sum problem is a classic algorithmic problem where the objective is to find all unique triplets in an array that sum up to a specific target value, usually zero. This problem is a popular interview question and is commonly used in coding challenges to test a candidate's understanding of arrays, sorting, and efficient algorithms.

The 3Sum problem can be divided into two categories based on whether the input array is sorted or unsorted.

3Sum on Unsorted Input

3Sum on Sorted Input

Miscellaneous Problems

Comment