Category Archives: Matrix

Given the integers N, M, R and C where N and M denotes the number of rows and columns in a matrix and (R, C)… 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 2D square matrix arr[][] of dimensions N x N, the task is to find the maximum path sum by moving diagonally from any… Read More
Given a matrix B[][] of dimensions N * M, the task is to generate a matrix A[][] of same dimensions that can be formed such… Read More
Given two integers i and j, the task is to print the i * j thmatrix element that can be obtained by filling the matrix… Read More
Given a matrix, mat[][] of size N * M and two positive integers A and B, the task is to construct a matrix of size… Read More
Given a binary matrix M[][] of dimensions N x N, the task is to make every pair of adjacent cells in the same row or… Read More
Given a matrix arr[][] of size N * M, the task is to print the matrix after removing all rows and columns from the matrix… Read More
Given a 2D matrix mat[][] of size N * M, the task is to find the median of Bitwise XOR of all possible submatrices from… Read More
Given a square matrix mat[][] of dimensions N * N, the task is to print the matrix that can be obtained after swapping the laterally… Read More
Given a matrix arr[][] of dimensions M * N, the task is to count the number of digits of every element present in the given… Read More
Given a matrix with N rows and M columns, the task is to find the minimum replacements requried to make all rows and columns of… Read More
An incidence matrix is simply a matrix that contains information about the relationship between objects (or instances) of any two classes. The rows of the… Read More
Given a matrix of dimensions N * M and a 2D array Queries[][] with each query of the form {k, r1, c1, r2, c2}, the… Read More
Given an upper triangular matrix M[][] of dimensions N * N, the task is to convert it into an one-dimensional array storing only non-zero elements… Read More