## Minimum cells to be flipped to get a 2*2 submatrix with equal elements

Given a matrix of size M * N, the task is to find the count of the minimum number of cells that must be flipped… Read More »

- Kth smallest element in a subarray
- Find the smallest positive number missing from an unsorted array | Set 3
- Remove duplicates from unsorted array using Set data structure
- Pair with largest sum which is less than K in the array
- Find the minimum number of moves to reach end of the array
- Sum of digits with even number of 1's in their binary representation
- Minimum number of Fibonacci jumps to reach end
- Calculate height of Binary Tree using Inorder and Level Order Traversal
- Reduce number to a single digit by subtracting adjacent digits repeatedly
- Count smaller elements on right side and greater elements on left side using Binary Index Tree
- Find sum of a[i]%a[j] for all valid pairs
- Find minimum changes required in an array for it to contain k distinct elements
- Maximum subsequence sum such that all elements are K distance apart
- Make the list non-decreasing by changing only one digit of the elements
- Queries for number of distinct elements in a subarray | Set 2
- Sort an array of strings according to string lengths using Map
- Count of triplets that satisfy the given equation
- Quadruplet pair with XOR zero in the given Array
- Number of Subsequences with Even and Odd Sum
- Find number of triplets in array such that a[i]>a[j]>a[k] and i<j<k
- Recursive program to find all Indices of a Number
- Find the sum of all possible pairs in an array of N elements
- Find the winner of the match | Multiple Queries
- Find subarray with given sum with negatives allowed in constant space
- Sum of the sums of all possible subsets
- Smallest element greater than X not present in the array
- Minimum Bitwise XOR operations to make any two array elements equal
- Minimum number of Bottles visible when a bottle can be enclosed inside another Bottle
- Optimal Strategy for a Game | Set 3
- Subsequence X of length K such that gcd(X[0], X[1]) + (X[2], X[3]) + ... is maximized

Given a matrix of size M * N, the task is to find the count of the minimum number of cells that must be flipped… Read More »

A permutation is a rearrangement of members of a sequence into a new sequence. For example, there are 24 permutations of [a, b, c, d].… Read More »

Given an array arr[] of N elements and a number of queries where each query will contain three integers L, R and K. For each… Read More »

Given K vectors, the task is to design a cyclic iterator that prints the elements of these vectors in a cyclic manner. For example: v1… Read More »

Given an array arr[] of size N. The task is to find the maximum subarray sum possible after performing the given operation at most once.… Read More »

Given an array of size N containing numbers only from 0 to 63, and you are asked Q queries regarding it. Queries are as follows:… Read More »

Given an array Q[] of size N – 1 such that each Q[i] = P[i + 1] – P[i] where P[] is the premutation of… Read More »

Given an integer N and an array seats[] where N is the number of people standing in a line to buy a movie ticket and… Read More »

Given an array of integers, the task is to calculate the sum of GCD of all the subarrays of an array. GCD of an array… Read More »

Consider an array A[] of integers and the following two types of queries. update(l, r, x): multiply x to all values from A[l] to A[r]… Read More »

Given a K-increasing-decreasing array arr[], the task is to sort the given array. An array is said to be K-increasing-decreasing if elements repeatedly increase upto… Read More »

Given an array arr, the task is to find the length of Longest Increasing Sequence using Binary Indexed Tree (BIT) Examples: Input: arr = {6,… Read More »

Given a connected, directional graph. Each node is connected to exactly two other nodes. There is weight associated with each edge denoting the cost to… Read More »

Given an array arr[] of N positive integers, the task is to find the count of indices i such that all the elements from arr[0]… Read More »

Given a binary array arr[] of size N. The task is to find the minimum number of inversions required so that no two adjacent elements… Read More »