# Tag Archives: submatrix

Given a character matrix consisting of O’s and X’s, find the number of submatrices containing only ‘X’ and surrounded by ‘O’ from all sides.  Examples:… Read More
Given a matrix mat of N*N (N is a perfect square|) and two points x and y, the task is to return all the elements of the… Read More
Given an N*M matrix Mat[][] containing all distinct integers, the task is to find the minimum area of the matrix (r*c, where 1 ≤ r… 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 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
Given a matrix arr[][] of size NxM and an integer K, the task is to find the count of square submatrices in the given matrix… Read More
Given a matrix mat[][] of size N x M and an array queries[] of size Q, containing (a, b) pairs. The task is to find… Read More
Given a matrix mat[][] of dimensions N * M, and an integer K, the task is to find the maximum sum of any rectangle possible… Read More
Prerequisite: Kadane’s algorithm Given a 2D array arr[][] of dimension N*M, the task is to find the maximum sum sub-matrix from the matrix arr[][]. Examples:… Read More
Given a positive integer N, the task is to construct a matrix of size N * N such that all the matrix elements are distinct… Read More
Given a binary matrix mat[][] of size M * N and Q queries of the form {pi, pj, qi, qj}, the task for each query… Read More
Given a 2D matrix mat[][] of size N * M and a positive integer K, the task is to find the area of the smallest… Read More
Given a matrix arr[][] of dimensions N * M, the task is to generate a matrix such that any cell (r, c) stores the sum… Read More
Given a 2D array, board[][] of size 9 × 9, which represents a solution to the Sudoku puzzle, the task is to check if the… Read More
Given a matrix m[][] of dimensions N × M and an integer K, calculate XOR(i, j) which is equal to the Bitwise Xor of all… Read More