## Find a triplet in an array whose sum is closest to a given number

Given an array arr[] of N integers and an integer X, the task is to find three integers in arr[] such that the sum is… Read More »

- Optimal Strategy for a Game | Set 2
- Sliding Window Maximum (Maximum of all subarrays of size k) using stack in O(n) time
- Building Heap from Array
- Find k closest numbers in an unsorted array
- Amazon Internship Interview Experience
- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- Create linked list from a given array
- Maximum sum such that no two elements are adjacent | Set 2
- Maximum Sum Subsequence of length k
- Sort an array without changing position of negative numbers
- Maximum absolute difference in an array
- Maximum element in a sorted and rotated array
- Given two arrays count all pairs whose sum is an odd number
- Find maximum xor of k elements in an array
- Kth smallest element in a subarray
- Count the triplets such that A[i] < B[j] < C[k]
- Find the longest string that can be made up of other strings from the array
- Find minimum difference between any two elements | Set 2
- Partition an array of non-negative integers into two subsets such that average of both the subsets is equal
- Introduction to Data Structures | 10 most commonly used Data Structures
- Count of integers of length N and value less than K such that they contain digits only from the given set
- Number of subsets with zero sum
- Split the given array into K sub-arrays such that maximum sum of all sub arrays is minimum
- Maximum sum combination from two arrays
- Greatest contiguous sub-array of size K
- Remove duplicate elements in an Array using STL in C++
- Find the smallest positive number missing from an unsorted array | Set 3
- Minimum cost to reach end of array array when a maximum jump of K index is allowed
- Find the minimum number of operations required to make all array elements equal
- Pair with largest sum which is less than K in the array

Given an array arr[] of N integers and an integer X, the task is to find three integers in arr[] such that the sum is… Read More »

Given an integer array arr[] of length N consisting of both positive and negative integers, the task is to find the number of sub-arrays with… Read More »

Given an array a[ ] and the number of adjacent swap operations allowed are K. The task is to find the max number that can… Read More »

Given an array of size N.There can be multiple queries of the following types. update(l, r) : On update, flip( multiply a[i] by -1) the… Read More »

Given a set of digits A[] in sorted order and two integers N and K, the task is to find how many numbers of length… Read More »

Given an array arr[] of N integers, the task is to print the largest element among the array such that its previous and next element… Read More »

Given three sorted integer arrays A[], B[] and C[], the task is to find three integers, one from each array such that they sum up… Read More »

Given an array arr[] of n integers. The task is to find the smallest perfect cube from the array. Print -1 if there is no… Read More »

Given an array arr[] of length N. The task is to check if there exists any subarray whose sum is a multiple of N. If… Read More »

Given an array of positive elements, you have to flip the sign of some of its elements such that the resultant sum of the elements… Read More »

Given an array arr[] of integers, the task is to find the maximum sum of any sub-sequence in the array such that any two adjacent… Read More »

Given a string str and an array of strings arr[], the task is to check if the given string can be formed by any of… Read More »

Given n Circles present in x-y plane such that all the circles have their center aligned on the x-axis. The task is to remove some… Read More »

Given infinte number of elements of form and ( n >= 0 ). The task is to find the minimum count of elements chosen such… Read More »

Given an array of n distinct elements and a number x, arrange array elements according to the absolute difference with x, i. e., the element… Read More »