# 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[][2] 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