##
Nearest 1 in a binary matrix
November 13, 2016

Given a binary matrix of order m*n, the task is to find the distance of nearest 1 for each 0 in the matrix and print… Read More »

November 13, 2016

Given a binary matrix of order m*n, the task is to find the distance of nearest 1 for each 0 in the matrix and print… Read More »

Given a matrix of integers where every element represents weight of the cell. Find the path having the maximum weight in matrix [N X N].… Read More »

November 11, 2016

Given a matrix of n x n size, the task is to find saddle point of the matrix. A saddle point is an element of… Read More »

November 10, 2016

A Latin Square is a n x n grid filled by n distinct numbers each appearing exactly once in each row and column. Given an… Read More »

November 8, 2016

Given a matrix of m*n size, the task is to count all the rows in a matrix that are sorted either in strictly increasing order… Read More »

November 7, 2016

Given an odd integer n, find a matrix of size n x n with following conditions: Each cell contains an integer from 1 and n… Read More »

November 3, 2016

Given a matrix M of size m x n ( 1 <= m,n <= 1000 ). It is initially filled with integers from 1 to… Read More »

August 28, 2016

Given a R x C (1 <= R, C <= 1000000000) grid and initial position as top left corner and direction as east. Now we… Read More »

August 26, 2016

Given a matrix that is filled with ‘O’, ‘G’, and ‘W’ where ‘O’ represents open space, ‘G’ represents guards and ‘W’ represents walls in a… Read More »

August 14, 2016

Given a path in the form of a rectangular matrix having few landmines arbitrarily placed (marked as 0), calculate length of the shortest safe route… Read More »

August 13, 2016

Given a 2D Matrix of order n X m , print K’th element in spiral form of matrix. See the following examples. Examples: Input: mat[][]… Read More »

August 4, 2016

Given an M x N matrix, with a few hurdles arbitrarily placed, calculate the length of longest possible route possible from source to destination within… Read More »

Given a square matrix, find if it’s a Toeplitz matrix or not. A Toeplitz (or diagonal-constant) matrix is a matrix in which each descending diagonal… Read More »

July 22, 2016

Given a N X N binary matrix, find the size of the largest ‘+’ formed by all 1s. Example: For above matrix, largest ‘+’ would… Read More »

July 20, 2016

Given a N x N binary matrix (elements in matrix can be either 1 or 0) where each row and column of the matrix is… Read More »