# Category Archives: Algorithms

Given a string str and an array of words word[], the task is to find whether str is a prefix string of word[]. Examples: Input:â€¦ Read More
Given three positive integers A, B, and C, the task is to find out that, if we divide any one of them with any integerâ€¦ Read More
Given 3 positive integers A, B, and C. Choose a positive integer M and multiply any one of A, B, or C with M. Theâ€¦ Read More
Given an array of pairs v[][] of size N which shows the score of the match at N instances where (v[i][0], v[i][1]) shows a scoreâ€¦ Read More
Given an integer N, the task is to find the number of distinct values possible for the bit-wise XOR of X and Y where 1â€¦ Read More
Given a Binary Tree rooted at root, the task is to find the sum of all leaf nodes which are left child of their parentsâ€¦ Read More
Given an array arr[] of size N. The task is to count the number of unique subsets.  Examples: Input: arr[] = {1, 2, 2}Output: 6Explanation:â€¦ Read More
Given an array arr[] of size N. The task is to maximize the minimum value of the array after performing given operations. In an operation,â€¦ Read More
Given an NxN square matrix M[][]. The task is to check whether the matrix M is a zero division matrix or not. A matrix isâ€¦ Read More
Given a matrix arr[][] of size M*N containing only positive integers, the task is to check if every row contains all the integers from 1â€¦ Read More
Given a string S of length N and a positive integer K, the task is to find the minimum total cost of picking K uniqueâ€¦ Read More
Given a string str of length N. The task is to print the frequency of adjacent repeating characters.  Examples: Input: str = “Hello”Output: l: 2Explanation:â€¦ Read More
Given a rectangle [(x1, y1), (x2, y2)] denoting the coordinates of bottom-left corner and top-right corner whose sides are parallel to coordinates axes and Nâ€¦ Read More
Given an array arr[] of size N and an integer representing an index K, the task is to find the minimum number of operations inâ€¦ Read More
Given an array arr[] of N integers where ith element represents the amount of water required by the plant at ith index and an integerâ€¦ Read More