## Remove duplicates from an array of small primes

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 »

- 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
- 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
- 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
- Pair with largest sum which is less than K in the array
- Find a triplet in an array whose sum is closest to a given number
- 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
- Sum of digits with even number of 1's in their binary representation
- Find XOR of numbers from the range [L, R]
- Minimum number of Fibonacci jumps to reach end
- Calculate height of Binary Tree using Inorder and Level Order Traversal
- Count pairs with given sum | Set 2
- Reduce number to a single digit by subtracting adjacent digits repeatedly
- Find sum of a[i]%a[j] for all valid pairs
- Count smaller elements on right side and greater elements on left side using Binary Index Tree
- Find minimum changes required in an array for it to contain k distinct elements
- Kth smallest element in the array using constant space when array can't be modified

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 »

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

Given an array, find the number of subarrays whose sum is even. Example : Input : arr[] = {1, 2, 2, 3, 4, 1} Output… Read More »