Given an integer N, the task is to find the minimum number of operations required to make N even such that in one operation prefix… Read More
Category Archives: Greedy
Given a square matrix mat[][] of dimension N and an integer K, the task is to rotate the matrix by 90 degrees K times without… Read More
Given a square matrix mat[][] of dimension N and an integer K, the task is to rotate the matrix by 90 degrees K times without… Read More
Given two arrays arr[] and brr[] containing integers. The task is to find the Kth largest product of a pair (arr[i], brr[j]). Examples: Input: arr[]… Read More
Given an array Arr[] of size N consisting of N pairwise distinct positive integers. The task is to find N – 1 different pair of… Read More
Given two integers N and K. Perform the following type of operations on N: if the last digit of N is non-zero, decrease the number… Read More
Given an array a, we have to find the minimum product possible with the subset of elements present in the array. The minimum product can… Read More
Given an array a, we have to find the minimum product possible with the subset of elements present in the array. The minimum product can… Read More
Given an array a, we have to find the minimum product possible with the subset of elements present in the array. The minimum product can… Read More
Given an array a, we have to find the minimum product possible with the subset of elements present in the array. The minimum product can… Read More
Given an array a, we have to find the minimum product possible with the subset of elements present in the array. The minimum product can… Read More
Given an M*N grid, and given an array startPos[], indicating that the starting position is the cell (startPos[0], startPos[1]) and the array homePos[] indicating its… Read More
Given an array arr[] of N integers, the task is to find the minimum value of K such that the sum of elements on indices… Read More
Given a string S of size N and a linked list, the task is to check if the linked list contains a string as a… Read More