Skip to content

Tag Archives: submatrix

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
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
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
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
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
Given an integer N, the task is to construct a matrix M[][] of size N x N with numbers in the range [1, N^2] with… Read More
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
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