Minimum number of operations required to set all elements of a binary matrix
Given a binary matrix mat[][] consisting of 1s and 0s of dimension M * N, the task is to find the number of operations to… Read More »
Given a binary matrix mat[][] consisting of 1s and 0s of dimension M * N, the task is to find the number of operations to… Read More »
Given a matrix grid[][] and two integers M and N, the task is to find the sum of cost of all possible paths from the… Read More »
Given three integers N, P and K, the task is to find the number of ways of painting K cells of 3 x N grid… Read More »
Given a matrix(mat[][]), which is sorted row and column-wise in increasing order. Two integers are given, L and R, our task is to count number… Read More »
Given a undirected Graph of N vertices 1 to N and M edges in form of 2D array arr[][] whose every row consists of two… Read More »
Given an odd number N which represents a grid of size N x N which is initially filled by coins, the task is to find… Read More »
Given a 2-D array of N rows and M columns and an integer K. The task is to find whether is it possible to take… Read More »
Given a binary matrix M where each element of the matrix will be 0 or 1, the task is to find the largest square that… Read More »
Given a 2D vector mat[][] of integers. The task is to sort the elements of the vectors diagonally from top-left to bottom-right in increasing order.… Read More »
Given a 2D matrix arr[][] of N*N dimensions, the task is to find the sum of elements of all four parts of the matrix divided… Read More »
Given a binary matrix mat[][] containing 0’s and 1’s. Each row of the matrix is sorted in the non-decreasing order, the task is to find… Read More »
Given a M x N matrix mat[][], the task is to count the number of cells which have the sum of its adjacent cells equal… Read More »
Given a matrix mat[][] of size N x N, the task is to traverse the matrix Diagonally in Bottom-up fashion using recursion. Diagonally Bottum-up Traversal:… Read More »
Given a matrix mat[][] and an integer K, the task is to find the maximum neighbor within an absolute distance of K for each element… Read More »
Given a matrix mat[][] and two integers K and S, the task is to count all K x K sub-matrix such that the sum of… Read More »