Longest subarray having difference in the count of 1’s and 0’s equal to k
Given a binary array arr[] of size n and a value k. The task is to find the length of the longest subarray having difference… Read More »
Given a binary array arr[] of size n and a value k. The task is to find the length of the longest subarray having difference… Read More »
Consider n boxes numbered arranged in a circle in increasing order in clockwise direction (numbered from 1 to n). You are given q queries, each… Read More »
Given two unsorted arrays arr1[] and arr2[]. They may contain duplicates. For each element in arr1[] count elements less than or equal to it in… Read More »
Given two arrays arr1[] and arr2[]. The task is to find the count of such elements in the first array whose at-least one factor is… Read More »
Prerequisites: Hashing Introduction and Collision handling by separate chaining How hashing works: For insertion of a key(K) – value(V) pair into a hash map, 2… Read More »
Suppose you are given an array with N elements with any integer values. You need to find the minimum number of elements of the array… Read More »
Given an array of integers.Let us say P is the product of elements of the array. Find the number of distinct prime factors of product… Read More »
In hashing there is a hash function that maps keys to some values. But these hashing function may lead to collision that is two or… Read More »
Given an array arr[] containing n integers. The problem is to find the length of the subarray having maximum sum. If there exists two or… Read More »
Given a range, the task is to find the count of the numbers in the given range such that the sum of its digit is… Read More »
Speed and internal implementation HashSet : For operations like search, insert and delete. It takes constant time for these operations on average. HashSet is faster… Read More »
Given an array arr[] containing numbers from 0 to 9 only, the task is to form the minimum possible number from the given digits and… Read More »
Given Inorder and Postorder traversals of a binary tree, print Preorder traversal. Example: Input: Postorder traversal post[] = {4, 5, 2, 6, 3, 1} Inorder… Read More »
Given a circular array containing only 0’s and 1’s, of size n where n = p*q (p and q are both odd integers). The task… Read More »
Given an array arr that has numbers appearing twice or once. The task is to identify numbers that occurred only once in the array. Note:… Read More »