Category Archives: Algorithms

Given an integer N, the task is to find the minimum number of steps to obtain N from M (M = 1 initially). In each… Read More
Given a binary string  str, the task is to determine if string str can be converted into a palindrome in K moves. In one move… Read More
Given a binary sequence of 1‘s and 0‘s. Our task is to remove all 1s from the sequence in minimum cost by below operations. Remove… Read More
Given an array A of n integers and two integers p and q, the task is to increase some (or all) of the values in… Read More
Given an array A of size n, the task is to check if the array can be sorted in increasing order, if the only operation… Read More
Given a range [L, R] and an integer K, the task is to check if it is possible to make the GCD of all integers… Read More
Given an integer N, the task is to find the sum of all values of N after repeatedly dividing it with its smallest factor. Examples:… Read More
Given an array arr[] of size N, the task is to find the number of pairs of the array upon removing which the mean (i.e.… Read More
Given two numeric strings S and Target, and integers X, M. The task is to check if string S can be converted into string Target… Read More
Given an array arr of length N and two integers K and X. For every element arri in the array, if arri > 0 then… Read More
Given an array arr of length N, the task is to find the minimum number of operations required to make all array elements 0, except… Read More
Given an array arr[] of N integers. Arrange the array in a way such that the minimum distance among all pairs of same elements is… Read More
Given an integer N, the task is to print a permutation of numbers from 0 to N-1, such that: There is no duplicate element in… Read More
Given an array height[] which represents the height of N people standing in a line. A person i can see a person j if height[j]… Read More
Given two arrays of strings SearchWord[] and FindWord[]. The task is to check how many strings in FindWord[] can be formed after the following operations… Read More