Subset LeetcodeIn Subset Leetcode problem we have given a set of distinct integers, nums, print all subsets (the read more
Dividing Array into Pairs With Sum Divisible by KThe dividing array into pairs with sum divisible by K is a problem which is asked in interviews read more
Count Distinct Elements in Every Window of Size KSubsets are something which we have been dealing with for some time now. In the last episode, we read more
Count Subsets Having Distinct Even NumbersWe have all struggled with the subset problem at some point or the other in an interview. The read more
Find Three Element From Different Three Arrays Such That a + b + c = sumThree Sum is a problem loved by interviewers. It is a problem I was personally asked during the read more
Longest Increasing SubsequenceWe are provided with an array of integers that is unsorted and we have to find the longest read more
Count Pairs Whose Products Exist in ArrayIn count pairs whose products exist in array problem we have given an array, count all the distinct read more
Merge Overlapping IntervalsIn merge overlapping intervals problem we have given a collection of intervals, merge and return read more
Median of Two Sorted ArraysGiven two sorted arrays A and B of size n and m respectively. Find the median of the final sorted read more
Maximum Product SubarrayIn the maximum product subarray problem, we have given an array of integers, find the contiguous read more
Find Maximum of Minimum for Every Window Size in a Given ArrayGiven an array a[ ] of size n. For every window size that varies from 1 to n in array print or find read more
Minimum Size Subarray SumGiven an array nums of a positive integer and a sum s, find the minimum size of a contiguous read more
Intersection of Two ArraysIn intersection of two arrays problem, we have given two arrays, we need to print their read more
Leetcode PermutationsIn this leetcode problem premutation we have given an array of distinct integers, print all of its read more
Search an Element in Sorted Rotated ArrayIn search in sorted rotated array problem we have given a sorted and rotated array and an element, read more
Maximum Product SubarrayGiven an array of n integers, find the maximum product obtained from a contiguous subarray of the read more
3 SumIn 3 Sum problem, we have given an array nums of n integers, find all the unique triplets that sum read more
Find The Duplicate NumberGiven an array nums containing (n + 1) elements and every element is between 1 to n. If there is read more
Maximum Sum of 3 Non-Overlapping SubarraysIn the maximum sum of 3 non-overlapping subarrays problem we have given an array nums of positive read more
Minimum Index Sum of Two ListsAnkur and Rishabh are two friends and want to buy some fruits from the market. They both have a read more
Split Array Into Consecutive SubsequencesGiven a sorted array(in ascending order), check if the array can be split into 1 or more read more
Find the Duplicate ElementGiven an array of integers of size n+1 where each element of the array is between 1 and n read more
Find the Only Repetitive Element Between 1 to N-1In finding the only repetitive element between 1 to N-1 problem we have given an array of random read more
Trapping Rain WaterIn Trapping Rain Water problem we have given N non-negative integers representing an elevation map read more
Finding K closest elementIn Finding K closest element problem we have given a sorted array and a value x. The problem is to read more
Jump GameIn jump game we have given an array of non-negative integers, you are initially positioned at the read more
Combination SumIn combination sum problem we have given an array of positive integers arr[] and a sum s, find all read more
Search in Sorted Rotated ArrayAn element search in sorted rotated array can be found using binary search in O(logn) time. The read more
Maximum SubarrayIn the Maximum Subarray problem we have given an integer array nums, find the contiguous sub array read more
Sliding Window MaximumIn Sliding Window Maximum problem we have given an array nums, for each contiguous window of size read more
Delete And EarnIn delete and earn problem we have given an array nums, you may perform the following operation on read more
Length of Longest Fibonacci SubsequenceGiven a strictly increasing array of positive integers, find the length of the longest fibonacci read more
Merging IntervalsIn merging intervals problem we have given a set of intervals of the form [l, r], merge the read more
First Bad VersionWe all have heard the saying “Bad Apple Ruins The Bunch”.First Bad Version is a problem read more
Peak Index in a Mountain ArrayWhat is Peak Index in a Mountain Array Problem? An array can be said as a Mountain Array if it read more
4SumIn the 4Sum problem, we have given an integer x and an array a[ ] of size n. Find all the unique read more
Create Maximum NumberIn the Create Maximum Number problem, we have given two arrays of length n and m with digits 0-9 read more
Degree of an arrayProblem Statement In the Degree of an array problem we have given a non-empty array of non-negative read more
Queue Reconstruction by HeightProblem Description of Queue Reconstruction by Height Suppose you have a random list of people read more
Search Insert PositionIn the Search Insert Position problem, we have given an integer x and a sorted array a[ ] of size read more
Find Peak ElementLet’s understand Find Peak Element problem. Today we have with us an array that needs its read more
Valid Triangle NumberProblem In the Valid Triangle Number problem, we have given an array of non-negative integers. read more
Power of TwoIn Power of Two problem we have given an integer, check if it is the power of 2 or not. A number in read more
Stone Game LeetCodeWhat is Stone Game problem? Stone Game LeetCode – Two players A and B are playing a stone read more
Maximum size subarray sum equals kIn Maximum size subarray sum equals k we have given an array of integers and a value k. You have to read more
Next greater elementThe next greater element is a problem in which we have given an array. This array containing N read more
Guess The WordGuess The Word is an interactive problem. An interactive problem means the data which is given to read more
Missing NumberIn Missing Number problem we have given an array of size N containing a number from 0 to N. All the read more
Merge Sorted ArrayIn merge sorted array problem we have given two sorted arrays in increasing order. In input first, read more
Partition Equal Subset SumPartition Equal Subset Sum is a problem in which we have given an array of positive numbers. We read more
Last Stone WeightLast Stone Weight is a problem in which we have a set of stones having some positive weights. Now read more
Sort ColorsSort colors is a problem in which we have to given an array containing N objects. Each box is read more
Rotate ArrayRotate array is a problem in which we have given an array of size N. We have to rotate the array in read more
Subarray Sum Equals kGiven an integer array and an integer k. Find total number of contiguous subarrays of given array read more
Infix to PostfixWhat is an infix expression? Expression in the form of ‘operand’ ‘operator’ ‘operand’ read more
Circular QueueA circular queue is an advanced form of a linear queue. In the linear queue, we can’t insert an read more
Given a sorted array and a number x, find the pair in array whose sum is closest to xALGORITHM TIME COMPLEXITY: O(N) SPACE COMPLEXITY: O(1) 1. We initialize two pointer like variable read more
Find the subarray whose sum is equal to a given number XExample INPUT 7, 3, 18, 2  and given number X = 23 OUTPUT SUBARRAY IS 3, 18, 2 whose sum is 23 read more
Arrange Even and Odd number such that Odd comes after EvenINPUT: 7  2  4  9  10  11  13  27 OUTPUT: 10  2  4  9  7  11  13  27 ALGORITHM TIME read more
Minimum number of Merge Operations to make an Array PalindromeIf it is not a palindrome it will make merge operations and prints the number of merge operations. read more
Form minimum number from given sequence of D’s and I’sExample 1 INPUT : DIDI OUTPUT : 21435 Example 2 INPUT : DIDII OUTPUT : 214356 In example 1, the read more
Longest span with same sum in two binary arraysGiven two binary arrays, array1 and array2 with same size. This function will print the longest read more
Find the Subarray of given length with Least AverageGiven an array and an input integer X, write a program to find the subarray of length X with read more
Find Zeros to be Flipped so that number of Consecutive 1’s is maximizedGiven a binary array and number of zeros to be flipped, write a program to find the zeros that read more
Merge K Sorted Arrays and Print Sorted OutputGiven k sorted arrays of size n each, write a program to merge those arrays and prints the sorted read more
Find the minimum element in a sorted and rotated arrayGiven a sorted array which is rotated at some unknown point, find the minimum element in that array read more
Find the point where a monotonically increasing function becomes positive first timeGiven a function ‘int f(unsigned int x)’ which takes a non-negative integer read more
Print all possible combinations of r elements in a given array of size nGiven an array of size n, find all combinations of size r in the array. Example INPUT: arr[] = read more
Sort Elements by frequencyGiven an array, Sort the array according to the frequency of the elements Example INPUT: arr[] = read more
Stock Buy Sell to Maximize ProfitGiven an array which contains stock price on each day, find the maximum profit that you can make by read more
Merge Overlapping IntervalsGiven a set of intervals, this function will merge the overlapping intervals into one and prints read more
Maximum Subarray Sum using Divide and ConquerGiven an array of both positive and negative integers, this function will find the largest sum of read more
Pancake sorting ProblemThis problem is based on pancake sorting. Given an unsorted array, we need to write a function read more
Pancake sortingGiven an unsorted array, this function uses only flip operation to sort the array. flip is the read more
Arrange given numbers to form the biggest numberGiven an array of positive integers, this function will arrange them in such way that the read more
Iterative Implementation of quick sortGiven an array, this function will sort the array using quick sort. Here, quick sort is not read more
Shuffle a given arrayGiven an array of integers, this function will shuffle the given array. That is, it will shuffle read more
Find the row with maximum number of 1’sGiven a matrix(2D array) containing binary digits with each row sorted, this function will find the read more
Sorting a k sorted arrayk sorted array: An array in which each element is at max k away from its position in the sorted read more
Maximum product subarrayGiven an array consisting of positive, negative integers and also zeroes, this function will find  read more
Largest subarray with equal number of 0’s and 1’sGiven an array, this function will find the largest subarray with equal number of 0’s and read more
Find the two numbers with odd occurrences in an unsorted arrayGiven an unsorted array in which other than two numbers all other numbers occur even number of read more
Maximum sum increasing subsequenceGiven an array, this function will find the sum of maximum subsequence of the given array, that is read more
Implement two stacks in an arrayImplementing two stacks in an array such that, if user wants to push an element in either of two read more
Number of smaller elements on right sideGiven an array, this function will print the number of smaller elements that are on the right side read more
Increasing subsequence of length three with maximum productIn the given array of positive integers, find the subsequence of length 3 with maximum product read more
Elements appear more than n/k times in arrayIn the given array of size n, find the elements which appear more than n/k times. Where k is the read more
Find the Peak element from an arrayIn the given input array of integers find a peak element In an array an element is a peak element, read more
Rearrange positive and negative numbers alternatively in ArrayIn the given random array with both positive and negative integers, rearrange the array so that read more
Find the maximum repeating number in arrayIn the given unsorted array of size N. Given array contains numbers in range {0, k} where k <= read more
HardTug of WarIn tug of war problem, we have given an array of integers, divide the array into two subsets of read more
First Circular Tour to Visit all the Petrol BunksIn the first circular tour to visit all the petrol bunks problem the statement is such that there read more
EasyCount Possible TrianglesIn count possible triangles problem we have given an array of n positive integers. Find the number read more
MediumMaximum Circular Subarray SumIn the maximum circular subarray sum problem, we have given an array of integers arranged in a read more
MediumFour Elements that Sum to GivenIn four elements that sum to a given problem, we have given an array containing N elements that may read more
HardMaximum Length of Chain PairsIn the maximum length of chain pairs problem we have given n pairs of numbers, find the longest read more
Find Pair with Given DifferenceIn the given unsorted array, find the pair of elements in the given array with given difference n. read more
HardPartition ProblemIn the Partition problem, we have given a set that contains n elements. Find whether the given set read more
The Celebrity ProblemIn the celebrity problem there is a room of N people, Find the celebrity. Conditions for Celebrity read more
MediumFind a Sorted Subsequence of size 3In the given unsorted array of integers. We need to find a sorted subsequence of size 3. Let three read more