##
Count all pairs with given XOR
November 20, 2016

Given an array of distinct positive integers and a number x, find the number of pairs of integers in the array whose XOR is equal… Read More »

November 20, 2016

Given an array of distinct positive integers and a number x, find the number of pairs of integers in the array whose XOR is equal… Read More »

November 5, 2016

Given a string which consists of only 0s, 1s or 2s, count the number of substrings that have equal number of 0s, 1s and 2s.… Read More »

October 4, 2016

Given N point on a 2D plane as pair of (x, y) co-ordinates, we need to find maximum number of point which lie on the… Read More »

October 3, 2016

Given an array of strings (all lowercase letters), the task is to group them in such a way that all strings in a group are… Read More »

July 6, 2016

Given a string and several queries on the substrings of the given input string to check whether the substring is a palindrome or not. Examples… Read More »

July 5, 2016

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 »

June 28, 2016

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

June 4, 2016

Given k sorted lists of integers of size n each, find the smallest range that includes at least element from each of the k lists.… Read More »

June 3, 2016

Given an array of distinct elements and a number x, find if there is a pair with product equal to x. Examples : Input :… Read More »

May 31, 2016

Given an array arr[0..n-1] of distinct elements and a range [low, high], find all numbers that are in range, but not in array. The missing… Read More »

May 25, 2016

Background : There are three basic operations that must be supported by a hash table (or a dictionary): Lookup(key): return true if key is there… Read More »

May 12, 2016

Given an m x n matrix, find all common elements present in all rows in O(mn) time and one traversal of matrix. Example: Input: mat[4][5]… Read More »

May 8, 2016

Every data structure has its own special characteristics for example a BST is used when quick searching of an element (in log(n)) is required. A… Read More »

April 16, 2016

Given an array of integers, and a number ‘sum’, find the number of pairs of integers in the array whose sum is equal to ‘sum’.… Read More »

April 14, 2016

Given an array with n distinct elements, convert the given array to a form where all elements are in range from 0 to n-1. The… Read More »