36 Problems
Array
Master array problems with detailed brute force and optimal solutions.
01
Reverse the array
Click to view brute force and optimal solutions
02
Find the maximum and minimum element in an array
Click to view brute force and optimal solutions
03
Find the Kth max and min element of an array
Click to view brute force and optimal solutions
04
Given an array which consists of only 0, 1 and 2. Sort the array without using any sorting algo
Click to view brute force and optimal solutions
05
Move all the negative elements to one side of the array
Click to view brute force and optimal solutions
06
Find the Union and Intersection of the two sorted arrays
Click to view brute force and optimal solutions
07
Write a program to cyclically rotate an array by one
Click to view brute force and optimal solutions
08
Find Largest sum contiguous Subarray [V. IMP]
Click to view brute force and optimal solutions
IMP
09
Minimise the maximum difference between heights [V.IMP]
Click to view brute force and optimal solutions
IMP
10
Minimum no. of Jumps to reach end of an array
Click to view brute force and optimal solutions
11
Find duplicate in an array of N+1 Integers
Click to view brute force and optimal solutions
12
Merge 2 sorted arrays without using Extra space
Click to view brute force and optimal solutions
13
Kadanes Algo [V.V.V.V.V IMP]
Click to view brute force and optimal solutions
IMP
14
Merge Intervals
Click to view brute force and optimal solutions
15
Next Permutation
Click to view brute force and optimal solutions
16
Count Inversion
Click to view brute force and optimal solutions
17
Best time to buy and Sell stock
Click to view brute force and optimal solutions
18
Find all pairs on integer array whose sum is equal to given number
Click to view brute force and optimal solutions
19
Find common elements In 3 sorted arrays
Click to view brute force and optimal solutions
20
Rearrange the array in alternating positive and negative items with O(1) extra space
Click to view brute force and optimal solutions
21
Find if there is any subarray with sum equal to 0
Click to view brute force and optimal solutions
22
Find factorial of a large number
Click to view brute force and optimal solutions
23
Find maximum product subarray
Click to view brute force and optimal solutions
24
Find longest consecutive subsequence
Click to view brute force and optimal solutions
25
Given an array of size n and a number k, find all elements that appear more than n/k times
Click to view brute force and optimal solutions
26
Maximum profit by buying and selling a share atmost twice
Click to view brute force and optimal solutions
27
Find whether an array is a subset of another array
Click to view brute force and optimal solutions
28
Find the triplet that sum to a given value
Click to view brute force and optimal solutions
29
Trapping Rain water problem
Click to view brute force and optimal solutions
30
Chocolate Distribution problem
Click to view brute force and optimal solutions
31
Smallest Subarray with sum greater than a given value
Click to view brute force and optimal solutions
32
Three way partitioning of an array around a given value
Click to view brute force and optimal solutions
33
Minimum swaps required bring elements less equal K together
Click to view brute force and optimal solutions
34
Minimum no. of operations required to make an array palindrome
Click to view brute force and optimal solutions
35
Median of 2 sorted arrays of equal size
Click to view brute force and optimal solutions
36
Median of 2 sorted arrays of different size
Click to view brute force and optimal solutions