Given an integer array nums, find all unique triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0. The solution set must not contain duplicate triplets.
You are given an integer array nums and an integer target. Find three integers in nums such that the sum is closest to the target. Return the sum of those three integers.
You are given an array of integers nums and a target value. Your task is to find all unique quadruplets [nums[a], nums[b], nums[c], nums[d]] such that the sum of the four numbers equals the target value. The indices a, b, c, and d should be distinct.
You are given an array of strings. Group the strings that are anagrams of each other together and return them as a list of lists. An anagram is a word or phrase formed by rearranging the letters of another word or phrase.
You are given an array of intervals where each interval is represented by a pair [start, end]. Merge all overlapping intervals and return a list of non-overlapping intervals that cover all the input intervals.
You are given an array of integers where each element represents a color: 0 for red, 1 for white, and 2 for blue. Your task is to sort the array such that all reds (0) appear first, followed by whites (1), and finally blues (2). Solve the problem in one pass with constant extra space, without using any built-in sort functions.