## 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 »

## Array class in C++

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 »

## Find Surpasser Count of each element in array

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 »

## Print all subarrays with 0 sum

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 »

## Directi Interview | Set 8 (Off-Campus)

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 »

## Amazon Interview Experience | Set 264 (Experienced for SDE1)

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 »

## Find frequency of each element in a limited range array in less than O(n) time

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 »

## Find subarray with given sum | Set 2 (Handles Negative Numbers)

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 »

## Find even occurring elements in an array of limited range

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 »

## Longest Common Prefix using Trie

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

## Minimum sum of two numbers formed from digits of an array

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 »

## Maximum value K such that array has at-least K elements that are >= K

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 »

## Longest Common Prefix using Character by Character Matching

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

## Longest Common Prefix using Word by Word Matching

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

## Find number of subarrays with even sum

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