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

- Sort an array without changing position of negative numbers
- Nth number whose sum of digit is multiple of 10
- Given two arrays count all pairs whose sum is an odd number
- Find maximum xor of k elements in an array
- What is Competitive Programming and How to Prepare for It?
- Find minimum difference between any two elements | Set 2
- Why Should I Learn Coding?
- Check whether two strings contain same characters in same order
- Total number of possible Binary Search Trees using Catalan Number
- Maximize the happiness of the groups on the Trip
- Find the number of pair of Ideal nodes in a given tree
- Lexicographically Smallest Topological Ordering
- Find the minimum number of elements that should be removed to make an array good
- Sum of digits with even number of 1's in their binary representation
- Find sub-arrays from given two arrays such that they have equal sum
- Count of all possible values of X such that A % X = B
- Equal Sum and XOR of three Numbers
- Check which player visits more number of Nodes
- Find the Nth Mosaic number
- Count of integers in a range which have even number of odd digits and odd number of even digits
- Check whether a number can be represented as sum of K distinct positive integers
- Optimally accommodate 0s and 1s from a Binary String into K buckets
- Longest string in an array which matches with prefix of the given string
- Generate elements of the array following given conditions
- Make the list non-decreasing by changing only one digit of the elements
- Count of strings whose prefix match with the given string to a given length k
- Check whether a subsequence exists with sum equal to k if arr[i]> 2*arr[i-1]
- Find the time which is palindromic and comes after the given time
- Find two vertices of an isosceles triangle in which there is rectangle with opposite corners (0, 0) and (X, Y)
- Print the path between any two nodes of a tree | DFS

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 »

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 »

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 »

Given an array of non-negative integers arr[], the task is to find a pair (n, r) such that nPr is maximum possible and r ≤… Read More »

Given an array of non-negative integers arr[]. The task is to find a pair (n, r) such that value of nCr is maximum possible r… Read More »

Given an array arr[] and an integer K, the task is to partition the array into K non-empty groups where each group is a subarray… Read More »

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 »