## Range maximum query using Sparse Table

Given an array arr[], the task is to answer queries to find the maximum of all the elements in the index range arr[L…R]. Examples: Input:… Read More »

## Maximize the Expression | Bit Manipulation

Given two positive integers A and B. Let’s define D such that B AND D = D. The task is to maximize the expression A… Read More »

## What is Competitive Programming and How to Prepare for It?

Programming… Competitive Programming… It teaches you how to think?. If you are a programmer you might have understood the deep meaning of these lines quoted… Read More »

## Print nodes having maximum and minimum degrees

Given an undirected graph having N nodes, the task is to print the nodes having minimum and maximum degree. Examples: Input: 1—–2 | | 3—–4… Read More »

## Maximum length sub-array which satisfies the given conditions

Given an array arr[] of N integers, the task is to find the maximum length of any sub-array of arr[] which satisfies one of the… Read More »

## Largest sub-matrix with all equal elements

Given a binary matrix of size N * M, the task is to find the largest area sub-matrix such that all elements in it are… Read More »

## Color all boxes in line such that every M consecutive boxes are unique

Given N boxes that are kept in a straight line and M colors such that M ≤ N. The position of the boxes cannot be… Read More »

## Queries for the minimum element in an array excluding the given index range

Given an array arr[] of N integers and Q queries where each query consists of an index range [L, R]. For each query, the task… Read More »

## Check if the Matrix satisfies the given conditions

Given a matrix mat[][], the task is to check whether the matrix is valid or not. A valid matrix is the matrix that satisfies the… Read More »

## Sort elements by modulo with K

Given an array arr[] of integers and an integer K. The task is to sort the elements of the given array in the increasing order… Read More »

## Count of Multiples of A ,B or C less than or equal to N

Given four integers N, A, B and C. The task is to find the count of integers from the range [1, N] which are divisible… Read More »

## time.h localtime() function in C with Examples

The localtime() function is defined in the time.h header file. The localtime( ) function return the local time of the user i.e time present at… Read More »

## Check if the rows of a binary matrix can be made unique by removing a single column

Given a binary matrix mat[][] of size M * N. The task is to check whether the row of the matrix will be unique after… Read More »

## Find out the prime numbers in the form of A+nB or B+nA

Given two integers A and B and an integer N. The task is to find out N prime numbers of the form A + nB… Read More »

## Count of triples (A, B, C) where A*C is greater than B*B

Given three integers A, B and C. The task is to count the number of triples (a, b, c) such that a * c >… Read More »