# Tag Archives: Constructive Algorithms

Given two string S1 and S2, the task is to check whether both the strings can be made equal by performing the given operation on… Read More
Given two numbers X and Y of the same length, the task is to find the minimum number d that needs to be added to… Read More
Given two integers N and M, where N is the number of friends sitting in a clockwise manner in a circle and M is the… Read More
Given a stack of integers and an integer K, the task is to sort the elements of the given stack using another stack in the… Read More
Given an array arr[] of size N, the task is to check if it is possible to make the array non-decreasing by applying the given… Read More
Given an array arr[] of size N. The task is to find maximum element among N – 1 elements other than arr[i] for each i… Read More
Given two integers N and K, the task is to find the element at the Kth position if all odd numbers from 1 to N… Read More
Given an array arr[] of N integers where N is even, the task is to group the array elements in the pairs (X1, Y1), (X2,… Read More
Given an integer N where 1 ≤ N ≤ 105, the task is to find the number of positive integers less than or equal to… Read More
Given an array arr[] of N distinct elements, the task is to check if it is possible to make the array increasing or decreasing by… Read More
Given string str of even size N consisting of lowercase English alphabets. The task is to find the number of rotated strings of str which… Read More
Given an integer N, the task is to divide the number into four parts such that the divided parts can be used to construct a… Read More
Given an array arr[] of size N having integers in the range [1, N] with some of the elements missing. The task is to find… Read More
Given two arrays A[] and B[] and two integers X and Y, the task is to choose X elements from A[] and Y elements from… Read More
Given an array arr[] of N positive integers. The task is to find the index of the elements which are equal to the sum of… Read More