# Tag Archives: Constructive Algorithms

Given an array Q[] of length N, the task is to find the permutation P[] of integers from the range [1, N + 1] suchâ€¦ Read More
Given an M x N matrix mat[][]. The task is to count the number of good cells in the matrix. A cell will be goodâ€¦ Read More
Given two integers A and B. The task is to find the count of all possible values X such that A % X = B.â€¦ Read More
Given an array arr[] of positive integers, the task is to find whether it is possible to make this array strictly increasing by modifying atmostâ€¦ Read More
Given a matrix mat[][], the task is to check if the given matrix is strictly increasing or not. A matrix is said to be strictlyâ€¦ Read More
Given a string str, the task is to check whether the given string is made up of only two alternating characters.Examples:   Input: str = “ABABABAB” Output:â€¦ Read More
Given two integer N and K, the task is to find the sum of all the numbers from the range [1, N] excluding those whichâ€¦ Read More
Given an array arr[] of non-negative integers. We have to delete elements from this array such that arr[i + 1] > arr[j] for each validâ€¦ Read More
There are infinite people standing in a row, indexed from 1. A person having index i has strength of i2. You have strength P andâ€¦ Read More
Given an integer array arr[] of size N and an integer K, the task is to find the index which will be the last toâ€¦ Read More
Given an array arr[] of N distinct integers, the task is to find the maximum element in an interval [L, R] such that the intervalâ€¦ Read More
Given an array of digits (values are from 0 to 9), find the minimum possible sum of two numbers formed from digits of the array.â€¦ Read More
Given an equilateral triangle made of dots (.) joined together to form triangle and an integer n which represents the length of the sides ofâ€¦ Read More
Given two integers N and Y, the task is to generate a sequence of N distinct non-negative integers whose bitwise-XOR of all the elements ofâ€¦ Read More
Given an array arr[] of 1’s and 2’s, the task is to re-arrange the array in such a way that the prefix sum of theâ€¦ Read More