# Category Archives: Algorithms

Given an array A[] of size N. In one operation only one subarray can be selected and replaced with the sum of the subarray. The… Read More
You are given X[] of length 2*N, Where N will always be odd, the task is to construct an array Y[] of length N from… Read More
Given N points moving along the X axis to the right whose initial position and speed are given in two arrays X[] (sorted in increasing… Read More
Given two integers N and M which denotes a matrix of size N*M that has the value of each cell as the sum of its… Read More
Given the cost[] and profit[] of N stocks and K tickets, the task is to find the maximum total profit that can be obtained from… Read More
Given an array arr[] of size N, the task is to find the maximum number of subsets the array can be split such that the… Read More
Given integer N, the task is to print an upside-down triangle where the left half is made of elements in the range [1, N*(N+1)/2] and… Read More
Given a list of words followed by two words, the task is to find the minimum distance between the given two words in the list… Read More
Given two integers N and M that denotes the number of rows and columns of a matrix that is initially empty, the task is to… Read More
Given a matrix of dimension N*N whose all cells are initially 0. You are given Q queries, each of type {a, b, c, d} where… Read More
Given a string S of length N, the task is to find two non-intersecting strings of equal length such that the sum of absolute differences… Read More
Given an array arr[] consisting of N distinct integers and an array Q[] consisting of M queries of the form [L, R], the task for… Read More
Given the coordinates of the centers of two circles (X1, Y1) and (X2, Y2) as well as the radii of the respective circles R1 and… Read More
Given a string S of size N consisting of characters from ‘0’to ‘9’, the task is to minimize the length of the string where In… Read More
Given two arrays of strings containing words[] and queries[] having N and Q strings respectively, the task is to find the number of strings from… Read More