## Find the number of sub arrays in the permutation of first N natural numbers such that their median is M

Given an array arr[] containing the permutation of first N natural numbers and an integer M ≤ N. The task is to find the number… Read More »

- Make all numbers of an array equal
- Sum of XOR of all subarrays
- Nth number whose sum of digit is multiple of 10
- Count common characters in two strings
- Merge K sorted arrays of different sizes | ( Divide and Conquer Approach )
- Sort an array without changing position of negative numbers
- Given two arrays count all pairs whose sum is an odd number
- Operations required to make the string empty
- Java ArrayList to print all possible words from phone digits
- Find minimum difference between any two elements | Set 2
- Interactive Problems in Competitive Programming
- Check whether two strings contain same characters in same order
- Program to find the kth character after decrypting a string
- Find two numbers whose divisors are given in a random order
- Sum of bitwise AND of all subarrays
- Total number of possible Binary Search Trees using Catalan Number
- Count of all possible values of X such that A % X = B
- Find sub-arrays from given two arrays such that they have equal sum
- Maximize the happiness of the groups on the Trip
- Find the minimum number of operations required to make all array elements equal
- Find the number of distinct pairs of vertices which have a distance of exactly k in a tree
- Check if a Queen can attack a given cell on chessboard
- Spanning Tree With Maximum Degree (Using Kruskal's Algorithm)
- Maximum subarray sum by flipping signs of at most K array elements
- Find the minimum number of elements that should be removed to make an array good
- Find the minimum number of preprocess moves required to make two strings equal
- Count how many times the given digital clock shows identical digits
- Shortest path on a Square
- Replace array elements by sum of next two consecutive elements
- Number of ways of scoring R runs in B balls with at most W wickets

Given an array arr[] containing the permutation of first N natural numbers and an integer M ≤ N. The task is to find the number… Read More »

Given an array of N integers. The task is to find the maximum difference between the index of any two different numbers. Note that there… Read More »

Interactive Problems are those problems in which our solution or code interacts with the judge in real time. When we develop a solution for an… Read More »

Given an array arr[] of size N. The task is to make all the array elements equal by applying the below operations minimum number of… Read More »

Given an undirected graph with N vertices and M edges and no self loops or multiple edges. The task is to convert the given undirected… Read More »

Given an array arr[] of size N. There are two types of operations: Update(l, r, x) : Increment the a[i] (l <= i <= r)… Read More »

Given three integers N, X and Y. The task is to find N positive integers that satisfy the given equations. a12 + a22 + ….… Read More »

Given a very large number N. The task is to find (1n + 2n + 3n + 4n) mod 5. Examples: Input: N = 4… Read More »

Given a permutation P (P1, P2, P3, … Pn) of first n natural numbers. Find the minimum number of operations to convert it into an… Read More »

Given an array arr[] containing GCD of every possible pair of elements of another array. The task is to find the original numbers which are… Read More »

Given a mat[][] of size n X n, the task is to find an element X such that if the anti-clockwise traversal is begun from… Read More »

Given an array arr[] of size n where arr[i] is the amount of candies of type i. You have unlimited amount of money. The task… Read More »

Given an array arr[] of size n, The task is to replace every element of the array by the sum of next two consecutive elements… Read More »

Given an undirected unweighted connected graph consisting of n vertices and m edges. The task is to find any spanning tree of this graph such… Read More »

Given an integer k and an array arr[], the task is to count the number of sub-arrays which have the sum equal to some positive… Read More »