Given a M x N matrix, print all its diagonal elements having positive slope.
Give a M x N matrix consisting of only 0 or 1, change all elements of row i and column j to 0 if cell (i, j) has value 0. Do this without using any extra space for every (i, j) having value 0.
Given a N x N matrix of positive integers, find shortest path from the first cell of the matrix to its last cell that satisfies given constraints.
Given a M x N matrix, shift all its elements by 1 in spiral order.
Given an array containing M*N elements, construct a M x N matrix from it in spiral order.
Given a positive number N, print a N x N spiral matrix containing numbers from 1 to N x N in counter clockwise direction and without using any extra space.
Given a MxN matrix, print matrix in spiral order.
Given a binary matrix where 0 represents water and 1 represents land, count the number of islands in it. A island is formed by connected one’s. For example, consider below image. Above image highlights water in blue and land in grey in a 10 x 10 matrix. There are total five islands present in the above …
Flood fill (also known as seed fill) is an algorithm that determines the area connected to a given node in a multi-dimensional array.
Given a rectangular field with few sensors present on it, cross it by taking the shortest safe route without activating the sensors. The rectangular field is given in the form of M x N matrix and we need to find the shortest path from any cell in first column to any cell in the …
Given a M x N matrix of characters, find all occurrences of a given string in the matrix. We are allowed to search the string in all eight possible directions i.e. North, West, South, East, North-East, North-West, South-East, South-West. Note that there should not be any cycles in the output path.
Given a maze in the form of the binary rectangular matrix, find length of the shortest path in a maze from given source to given destination.