## Minimum element of each row and each column in a matrix

Given a matrix, the task is to find the minimum element of each row and each column. Examples: Input: [1, 2, 3] [1, 4, 9]… Read More »

## Product of middle row and column in an odd square matrix

Given an integer square matrix of odd dimensions (3 * 3, 5 * 5). The task is to find the product of the middle row… Read More »

## Minimum cost to cover the given positions in a N*M grid

Given a n*m grid and the position of some poles to be painted in the grid, the task is to find the minimum cost to… Read More »

## Program to convert given Matrix to a Diagonal Matrix

Given a N*N matrix. The task is to convert the matrix to a diagonal matrix. That is to change the values of the non diagonal… Read More »

## Search a string in Matrix Using Split function in Java

Given a string str and a matrix mat[][] of lowercase English alphabets, the task is to find whether the string str appears in the matrix… Read More »

## Paths with maximum number of ‘a’ from (1, 1) to (X, Y) vertically or horizontally

Given a N X N matrix consisting of characters. Also given are Q queries, where each query contains a co-ordinate (X, Y). For every query,… Read More »

## Find Maximum side length of square in a Matrix

Given a square matrix of odd order N. The task is to find the side-length of the largest square formed in the matrix. A square… Read More »

## Farthest distance of a 0 from the center of a 2-D matrix

Given a matrix of odd order mat, the task is to find the farthest distance of a 0 from the center of the matrix. Distance… Read More »

## Maximum difference of indices (i, j) such that A[i][j] = 0 in the given matrix

Given a matrix of order n*n, the task is to find the maximum value of |i-j| such that Aij = 0. Given matrix must contain… Read More »

## Number of cells in the right and left diagonals passing through (x, y) in a matrix

Given four integers row, col, x and y where row and col are the number of rows and columns of a 2-D Matrix and x… Read More »

## Magical Pattern

Given an integer N as input, the task is to print the Magical Pattern as given below: N . . 3 2 1 2 3… Read More »

## Finding inverse of a matrix using Gauss – Jordan Method | Set 2

Given a Matrix, the task is to find the inverse of this Matrix using the Gauss-Jordan method. What is matrix? Matrix is an ordered rectangular… Read More »

## Find maximum path length in a binary matrix

Given a square matrix mat every element of which is either 0 or 1. A value 1 means connected and 0 means not connected. The… Read More »

## Find single Movement in a Matrix

Given four integers x1, y1 and x2, y2 which represent two locations in an infinite 2D-Matrix, the task is to find whether it is possible… Read More »

## Search in a sorted 2D matrix (Stored in row major order)

Given an integer ‘K’ and a row-wise sorted 2-D Matrix i.e. the matrix has the following properties: Integers in each row are sorted from left… Read More »