## Longest subarray having count of 1s one more than count of 0s

Given an array of size n containing 0’s and 1’s only. The problem is to find the length of the longest subarray having count of… Read More »

- k-th missing element in an unsorted array
- Count of words that are present in all the given sentences
- Find the longest string that can be made up of other strings from the array
- Minimum length substring with exactly K distinct characters
- Count occurrences of a string that can be constructed from another given string
- Sum of nodes in bottom view of Binary Tree
- Rearrange characters in a string such that no two adjacent are same using hashing
- Split the array elements into strictly increasing and decreasing sequence
- 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
- Find uncommon characters of the two strings | Set 2
- Count of unique pairs (arr[i], arr[j]) such that i < j
- Remove all occurrences of any element for maximum array sum
- 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
- Flip minimum signs of array elements to get minimum sum of positive elements possible
- Count equal pairs from given string arrays
- Count of pairs of strings which differ in exactly one position
- Two equal sum segment range queries
- Count all elements in the array which appears at least K times after their first occurrence
- Minimum changes required to make a Catalan Sequence
- Maximum product from array such that frequency sum of all repeating elements in product is less than or equal to 2 * k
- Find d to maximize the number of zeros in array c[] created as c[i] = d*a[i] + b[i]
- Longest subsequence such that every element in the subsequence is formed by multiplying previous element with a prime
- Count of pairs between two arrays such that the sums are distinct
- Find the lexicographically smallest sequence which can be formed by re-arranging elements of second array
- Longest sub-sequence of array containing Lucas numbers

Given an array of size n containing 0’s and 1’s only. The problem is to find the length of the longest subarray having count of… Read More »

Given a string, find the maximum number of characters between any two same character in the string. If no character repeats, print -1. Examples: Input… Read More »

There are many points in two-dimensional space which need to be visited in a specific sequence. Path from one point to other is always chosen… Read More »

Given a limited range array contains both positive and non-positive numbers, i.e., elements are in the range from -MAX to +MAX. Our task is to… Read More »

Given an unsorted array. The task is to calculate the cumulative frequency of each element of the array using count array. Examples: Input : arr[]… Read More »

Given a binary string. We need to find the length of longest balanced sub string. A sub string is balanced if it contains equal number… Read More »

Given an array, for each element find the value of nearest element to the right which is having frequency greater than as that of current… Read More »

We have introduced Graph implementation using array of vectors in Graph implementation using STL for competitive programming | Set 1. In this post, a different… Read More »

Given an array of distinct integers, print all the pairs having positive value and negative value of a number that exists in the array. We… Read More »

Given two sequences, one is increasing sequence a[] and another a normal sequence b[], find the K-th missing element in the increasing sequence which is… Read More »

Given an unsorted array of n elements and also given two points num1 and num2. The task is to count number of elements occurs between… Read More »

I got a call from a consulting firm regarding this opening. Round 1: Hackerank Online test:(1.5 hours) It had two questions. you have to pass… Read More »

Print the shortest sub-string of a string containing all the given words. In the first example, two solutions are possible: “world is here. this is… Read More »

Prerequisite – Hashing Introduction, Implementing our Own Hash Table with Separate Chaining in Java In Open Addressing, all elements are stored in the hash table… Read More »

Given a binary string of length N and an integer K, we need to find out how many substrings of this string are exist which… Read More »