# Category Archives: Algorithms

Given a car race track of length N units. where each car moves with a speed of 1 unit per second. Given two arrays left[]… Read More
Given an array arr[] of size N that contains the differences between the adjacents elements of an array. The task is to generate all possible… Read More
Python Given binary string str of size, N. Select any substring from the string and remove all the occurrences of the minority character (i.e. the… Read More
Given two positive integers X and Y. The task is to find the minimum possible number such that the number has X decimal digits &… Read More
Given a matrix arr[][] of size N*M The task is to find the index of the row that has the maximum unique elements. If there… Read More
Given two arrays a[] and b[] of size N and an integer K. The task is to find the maximum power that can be achieved… Read More
Given a binary matrix of size N * N, mat[][]. Value at cell (i, j) indicates what ith person says about jth person. A person… Read More
Given an array arr[] of N elements, the task is to find the length of the longest increasing subsequence whose adjacent element difference is one. … Read More
Given K (K > 2) arrays of different sizes in a 2D list arr[][] where elements in each array are non-negative. Find the minimum common… Read More
Given 2 arrays arr1[] and arr2[] of size N the task is to find the minimum product of maximums of both arrays by performing a… Read More
Given an array arr[] of N integers. The task is to convert the array into an Arithmetic Progression with the minimum number of replacements possible.… Read More
Given two arrays arr1[] and arr2[] of N size each. Select any index i and swap the element arr1[i] and arr2[i]. By applying this operation… Read More
Given a vector vec, and integers X and K, the task is to keep replacing X with product of X and K, each time X… Read More
Given a string S representing an N digit integer, the task is to find the maximum number of digits that can be removed such that… Read More
Given two integers D and K. The task is to find the smallest number N which has at least K prime divisors and the difference… Read More