# Category Archives: Matrix

Given an integer N, The task is to construct a matrix mat[][] of size M x M (‘M’ is the number of digits in the… Read More
Given a number N and an infinite 2D matrix, which is to be filled using the algorithm given below, the task is to find the… Read More
Given a matrix mat[][] of dimensions N*M and an array target[] of M integers, the task is to check whether any row of the matrix… Read More
Given a square matrix, turn it by 90 degrees in anti-clockwise direction without using any extra space.Examples :   Input: Matrix: 1 2 3 4 5… Read More
Given two binary matrices A[] and B[] of dimension N * M and a positive integer K, the task is to find the minimum number… Read More
Given a 2-D array matrix[][] of size M*N and an integer K. For each occurrence of K in the matrix[][], replace K and all the… Read More
Given a N x N chessboard with a Knight initially standing on the Xth row and Yth column, the task is to print all possible… Read More
Given a N x M matrix. Each cell of the matrix has a numerical value pointing to the next cell it leads to. The values… Read More
Given a 2D array, print it in reverse spiral form. We have already discussed Print a given matrix in spiral form. This article discusses how… Read More
Given a binary matrix mat[][] of dimensions M*N, the task is to check whether there exist T continuous blocks of 0s or not and at… Read More
Given a matrix mat[][] of dimensions N*M, the task is to check if all the diagonals of the matrix(from top-right to bottom-left) are palindromic or… Read More
Prerequisite: Prefix Sum – 3D Given a 3-Dimensional array of integers arr[L][R][C] (where L, R, and C are dimensions of the array) and 6 integers… Read More
Given a binary matrix mat[][] of dimensions N*M, the task is to find the number of corner rectangles that can be formed. A corner rectangle… Read More
Given two 2D binary arrays, a[][] and b[][] both of size M*N, the task is to pair each row in the array a[][] with any… Read More
Given a matrix mat[][] of dimensions N*M, the task is to find the size of the largest square submatrix such that the sum of all… Read More