## 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 »

- What is Competitive Programming and How to Prepare for It?
- Why Should I Learn Coding?
- Lexicographically Smallest Topological Ordering
- Find the number of pair of Ideal nodes in a given tree
- Sum of digits with even number of 1's in their binary representation
- Equal Sum and XOR of three Numbers
- Check which player visits more number of Nodes
- Count of integers in a range which have even number of odd digits and odd number of even digits
- Make the list non-decreasing by changing only one digit of the elements
- Print the path between any two nodes of a tree | DFS
- Convert an unbalanced bracket sequence to a balanced sequence
- Nth XOR Fibonacci number
- Write a function to get the intersection point of two Linked Lists | Set 2
- Print all the permutation of length L using the elements of an array | Iterative
- Number of substrings that start with "geeks" and end with "for"
- Find a pair (n,r) in an integer array such that value of nPr is maximum
- Check if a cycle of length 3 exists or not in a graph that satisfy a given condition
- Count occurrences of a prime number in the prime factorization of every element from the given range
- Reversing a Queue using another Queue
- Minimum increment or decrement operations required to make the array sorted
- Check if the rows of a binary matrix can be made unique by removing a single column
- Number of Subarrays with positive product
- Queries for the minimum element in an array excluding the given index range
- Longest Increasing Subsequence using Longest Common Subsequence Algorithm
- Print nodes having maximum and minimum degrees
- Color all boxes in line such that every M consecutive boxes are unique
- Minimize the sum of the array according the given condition
- Count of triples (A, B, C) where A*C is greater than B*B
- Find two co-prime integers such that the first divides A and the second divides B
- Sum of all natural numbers from L to R ( for large values of L and R )

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »