## Number of ways to distribute N Paper Set among M students

Given N students and a total of M sets of question paper where M ≤ N. All the M sets are different and every sets… Read More »

## What Are The Best Resources For Competitive Programming?

Gennady Korotkevich, Petr Mitrichev, Adam D’Angelo…. Have you heard the above name ever…?? Let me tell you who they are… First two people (Gennady Korotkevich,… Read More »

## Check if a number is Euler Pseudoprime

Given an integer N and a base number A, the task is to check whether N is a Euler Pseudoprime to the given base A.… Read More »

## Number of non-decreasing sub-arrays of length less than or equal to K

Given an array arr[] of N elements and an integer K, the task is to find the number of non-decreasing sub-arrays of length less than… Read More »

## Find Partition Line such that sum of values on left and right is equal

Consider n points on the Cartesian Coordinate Plane. Let point (Xi, Yi) is given a value Vi. A line parallel to y-axis is said to… Read More »

## Maximize the expression (A AND X) * (B AND X) | Bit Manipulation

Given two positive integers A and B such that A != B, the task is to find a positive integer X which maximizes the expression… Read More »

## Sorting objects using In-Place sorting algorithm

Given an array of red, blue and yellow objects, the task is to use an in-place sorting algorithm to sort the array in such a… Read More »

## Check if the bracket sequence can be balanced with at most one change in the position of a bracket | Set 2

Given a bracket sequence as a string str, the task is to find whether the given string can be balanced by moving at most one… Read More »

## Length of the longest subsegment which is UpDown after inserting atmost one integer

A sequence of integers is said to be UpDown, if the inequality holds true. You are given a sequence . You can insert at most… Read More »

## Generate an array B[] from the given array A[] which satisfies the given conditions

Given an array A[] of N integers such that A + A + A + … A[N – 1] = 0. The task is to… Read More »

## Find the path from root to the given nodes of a tree for multiple queries

Given a tree with N vertices numbered from 0 to N – 1 (0th node is the root node). Also, given q queries containing nodes… Read More »

## Arrow operator -> in C/C++ with Examples

An Arrow operator in C/C++ allows to access elements in Structures and Unions. It is used with a pointer variable pointing to a structure or… Read More »

## Minimum increment or decrement operations required to make the array sorted

Given an array arr[] of N integers, the task is to sort the array in non-decreasing order by performing the minimum number of operations. In… Read More »

## Longest Increasing Subsequence using Longest Common Subsequence Algorithm

Given an array arr[] of N integers, the task is to find and print the Longest Increasing Subsequence. Examples: Input: arr[] = {12, 34, 1,… Read More »

## Minimum number of additons to make the string balanced

Given a string str of lowercase characters, the task is to find the minimum number of characters that need to added to the string in… Read More »