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
Category Archives: Algorithms
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