## Maximize arr[j] – arr[i] + arr[l] – arr[k], such that i < j < k < l

Maximize arr[j] – arr[i] + arr[l] – arr[k], such that i < j < k < l. Find the maximum value of arr[j] – arr[i]… Read More »

- Optimal Strategy for a Game | Set 2
- Maximum Sum Subsequence of length k
- Maximum sum such that no two elements are adjacent | Set 2
- Sort an array without changing position of negative numbers
- Kth smallest element in a subarray
- Introduction to Data Structures | 10 most commonly used Data Structures
- Count the triplets such that A[i] < B[j] < C[k]
- Find maximum xor of k elements in an array
- 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
- 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
- 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
- Maximum sum combination from two arrays
- Flip minimum signs of array elements to get minimum sum of positive elements possible
- Remove duplicates from unsorted array using Set data structure
- Maximum water that can be stored between two buildings
- Pair with largest sum which is less than K in the array
- Iterative approach to print all permutations of an Array
- Find the smallest positive number missing from an unsorted array : Hashing Implementation
- Find a triplet in an array whose sum is closest to a given number
- Maximize the happiness of the groups on the Trip
- Rearrange numbers in an array such that no two adjacent numbers are same
- Divide the array in K segments such that the sum of minimums is maximized
- Find the minimum number of moves to reach end of the array
- Find the minimum number of elements that should be removed to make an array good

Maximize arr[j] – arr[i] + arr[l] – arr[k], such that i < j < k < l. Find the maximum value of arr[j] – arr[i]… Read More »

A k-Almost Prime Number is a number having exactly k prime factors (not necessary distinct). For example, 2, 3, 5, 7, 11 ….(in fact all… Read More »

Given an array of primes such that the range of primes is small. Remove duplicates from the array. Examples: Input : arr[] = {3, 5,… Read More »

The introduction of array class from C++11 has offered a better alternative for C-style arrays. The advantages of array class over C-style array are :-… Read More »

A surpasser of an element of an array is a greater element to its right, therefore x[j] is a surpasser of x[i] if i <… Read More »

Given an array, print all subarrays in the array which has sum 0. Examples: Input: arr = [6, 3, -1, -3, 4, -2, 2, 4,… Read More »

I applied for Directi off-campus on its career website and I got a call. There were total 5 rounds. Online coding round: 1.5 hours There… Read More »

I had around 1 year and 9 months of experience. And applied for SDE1 First Round (F2F): 1. What are data structures in which you… Read More »

Given an sorted array of positive integers, count number of occurrences for each element in the array. Assume all elements in the array are less… Read More »

Given an unsorted array of integers, find a subarray which adds to a given number. If there are more than one subarrays with the sum… Read More »

Given an array that contains odd number of occurrences for all numbers except for a few elements which are present even number of times. Find… Read More »

Given a set of strings, find the longest common prefix. Input : {“geeksforgeeks”, “geeks”, “geek”, “geezer”} Output : “gee” Input : {“apple”, “ape”, “april”} Output… Read More »

Given an array of digits (values are from 0 to 9), find the minimum possible sum of two numbers formed from digits of the array.… Read More »

Given an array of positive integers, find maximum possible value K such that the array has at-least K elements that are greater than or equal… Read More »