# Tag Archives: submatrix

## Final Matrix after incrementing submatrices by K in range given by Q queries

Given a 2D matrix mat[][] of size N*M and Q queries of the form {x1, y1, x2, y2, K}. For each query, the task is… Read More »

## Binary Matrix after flipping submatrices in given range for Q queries

Given a binary matrix arr[][] of dimensions M x N and Q queries of the form (x1, y1, x2, y2), where (x1, y1) and (x2,… Read More »

## Count of Rectangles with area K made up of only 1s from given Binary Arrays

Given two binary arrays A[] and B[], of length N and M respectively, the task is to find the number of rectangles of area K… Read More »

## Maximum sum of any submatrix of a Matrix which is sorted row-wise and column-wise

Given a matrix mat[][] whose elements are sorted both row-wise and column-wise. The task is to find the maximum sum of any submatrix from the… Read More »

## Construct a Matrix whose sum of diagonals for each square submatrix is even

Given an integer N, the task is to construct a matrix M[][] of size N x N with numbers in range [1, N^2], such that… Read More »

## Find maximum of minimums from Layers of Matrix using numbers 1 to N^2

Given a square matrix of size N*N using numbers 1 to N^2, the task is to find the maximum of minimums of each layer of… Read More »

## Create matrix whose sum of diagonals in each sub matrix is even

Given a number N, the task is to create a square matrix of size N*N with values in range [1, N*N], such that the sum… Read More »

## Count of submatrix with sum X in a given Matrix

Given a matrix of size N x M and an integer X, the task is to find the number of sub-squares in the matrix with… Read More »

## Check if a matrix contains a square submatrix with 0 as boundary element

Given an N*N binary matrix arr[][], the task is to check if the matrix contains a square of at least size 2 x 2 whose… Read More »

## Count all square sub-matrix with sum greater than the given number S

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 »

## Maximum size square Sub-Matrix with sum less than or equals to K

Given a Matrix arr[][] of size MxN having positive integers and a number K, the task is to find the size of largest square sub-matrix… Read More »

## Submatrix of given size with maximum 1’s

Given a binary matrix mat[][] and an integer K, the task is to find the submatrix of size K*K such that it contains maximum number… Read More »

## Find Maximum Length Of A Square Submatrix Having Sum Of Elements At-Most K

Given a N x M matrix where N is the number of rows and M is the number of columns in the given matrix and… Read More »

## Largest row-wise and column-wise sorted sub-matrix

Given an N * M matrix mat[][], the task is to find the area-wise largest rectangular sub-matrix such that each column and each row of… Read More »