## Find the first repeating element in an array of integers

Given an array of integers, find the first repeating element in it. We need to find the element that occurs more than once and whose… Read More »

- k-th missing element in an unsorted array
- Number of unique pairs in an array
- Choose atleast two elements from array such that their GCD is 1 and cost is minimum
- Count of words that are present in all the given sentences
- Minimum length substring with exactly K distinct characters
- Find the longest string that can be made up of other strings from the array
- Count occurrences of a string that can be constructed from another given string
- Sum of nodes in bottom view of Binary Tree
- Split the array elements into strictly increasing and decreasing sequence
- Rearrange characters in a string such that no two adjacent are same using hashing
- Sum of nodes in top view of binary tree
- Maximum length of the sub-array whose first and last elements are same
- Count duplicates in a given linked list
- Remove all occurrences of any element for maximum array sum
- Find uncommon characters of the two strings | Set 2
- Count of unique pairs (arr[i], arr[j]) such that i < j
- Minimum number of given operations required to convert a permutation into an identity permutation
- Number of subarrays such that XOR of one half is equal to the other
- Print the first shortest root to leaf path in a Binary Tree
- Design a stack which can give maximum frequency element
- Count of pairs of strings which differ in exactly one position
- Two equal sum segment range queries
- Flip minimum signs of array elements to get minimum sum of positive elements possible
- Count all elements in the array which appears at least K times after their first occurrence
- Minimum changes required to make a Catalan Sequence
- Count equal pairs from given string arrays
- Find d to maximize the number of zeros in array c[] created as c[i] = d*a[i] + b[i]
- Maximum product from array such that frequency sum of all repeating elements in product is less than or equal to 2 * k
- Longest sub-sequence of array containing Lucas numbers
- Find the lexicographically smallest sequence which can be formed by re-arranging elements of second array

Given an array of integers, find the first repeating element in it. We need to find the element that occurs more than once and whose… Read More »

Given a Binary Tree where every node has following structure. struct node { int key; struct node *left,*right,*random; } The random pointer points to any… Read More »

Given a string, Check if characters of the given string can be rearranged to form a palindrome. For example characters of “geeksogeeks” can be rearranged… Read More »

Suppose we want to design a system for storing employee records keyed using phone numbers. And we want following queries to be performed efficiently: Insert… Read More »

Given a binary tree, print it vertically. The following example illustrates vertical order traversal. 1 / \ 2 3 / \ / \ 4 5… Read More »

Given an array of positive and negative numbers, find if there is a subarray (of size at-least one) with 0 sum. Examples : Input: {4,… Read More »

Given an integer array and a positive integer k, count all distinct pairs with difference equal to k. Examples: Input: arr[] = {1, 5, 3,… Read More »

Given a stream of characters, find the first non-repeating character from stream. You need to tell the first non-repeating character in O(1) time at any… Read More »

Given an array of words, print all anagrams together. For example, if the given array is {“cat”, “dog”, “tac”, “god”, “act”}, then output may be… Read More »

Given an array of integers, find any one combination of four elements in the array whose sum is equal to a given value X. For… Read More »

Given an array containing only 0s and 1s, find the largest subarray which contain equal no of 0s and 1s. Expected time complexity is O(n).… Read More »

Given two Linked Lists, create union and intersection lists that contain union and intersection of the elements present in the given lists. Order of elments… Read More »

Given a Binary Tree, find the vertical sum of the nodes that are in the same vertical line. Print all sums through different vertical lines.… Read More »

Given two arrays: arr1[0..m-1] and arr2[0..n-1]. Find whether arr2[] is a subset of arr1[] or not. Both the arrays are not in sorted order. It… Read More »