# Category Archives: Matrix

Given a matrix mat[][] of size M x N where mat[i][j], the task is to find the maximum possible sum by picking contiguous elements fromâ€¦ Read More
The below program adds two square matrices of size 4*4, we can change N for different dimensions.Â  Recommended: Please solve it on “PRACTICE” first, beforeâ€¦ Read More
Given an integer matrix mat[][] of size M x N and an integer K, the task is to return the number of paths from top-leftâ€¦ Read More
Given a 2D binary matrix of size N * M, where 0 represents an empty space while 1 represents a wall you cannot walk through.â€¦ Read More
Given an N x N binary matrix grid, where 0 represents a sea cell and 1 represents a land cell. A move consists of walkingâ€¦ Read More
Given a matrix of size N * M. Every cell of the matrix contains either ‘A’ or ‘B’. Exchange is defined as swapping the charactersâ€¦ Read More
Given an NÃ—N Matrix Mat[][] of N rows and N columns. There is exactly one Queen on the chessboard and the cell that is underâ€¦ Read More
Given an 8 X 8 matrix of characters ‘*’ and ‘K’  as a chessboard in which K represents the position of the King and theâ€¦ Read More
Given an matrix mat[][] of size N*N (N > 2) such that mat[i][j] = arr[i]*arr[j] (where arr[] is a N sized array that is notâ€¦ Read More
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 of size N*M, the task is to find the product of all possible pairs of (i, j) where i and j areâ€¦ Read More
Given an undirected graph with V vertices in the form of an adjacency matrix, the weight of any two edges cannot be the same. Forâ€¦ Read More
Given a matrix Mat of size N x M, the task is to find all the pairs of rows and columns where the sum ofâ€¦ Read More
Given an NÃ—N matrix mat[][] and an integer K, the task is to search K in mat[][] and if found return its indices. Examples: Input:â€¦ Read More
Given a matrix of size N * N containing only 0s and 1s, where 0 represents white and 1 represents black. The task is toâ€¦ Read More