Given a M x N boggle board, find list of all possible words that can be formed by a sequence of adjacent characters on the the board.
Given a M x N matrix, count number of different ways to reach the bottom-right corner of a matrix from its top-left corner with exactly K turns allowed and using only the directions right or down.
In this post, we will see how to sort N2 numbers in increasing order using a N x N Young tableau in O(N3) time.
A M x N Young tableau is an M x N matrix such that the entries of each row are in sorted order from left to right and the entries of each column are in sorted order from top to bottom. Some of the entries of a Young tableau may be infinity, which indicates an …
Given a binary matrix, find the largest square sub-matrix which is surrounded by all 1’s.
Given a binary M x N row-wise sorted matrix, find a row which contains maximum number of 1 in linear time.
Given a M x N matrix, find all common elements present in every row.
Given a M x N matrix where each cell contains a coin of some denomination, collect maximum value of coins by traversing the grid. The first traversal starts from the top-left corner of the matrix and end at the bottom-left corner and the second traversal starts from the top-right corner and end at the bottom-right …
Given a M x N rectangular grid, efficiently count all paths starting from the first cell (0,0) to the last cell (N-1,M-1) in the grid. We can either move down, or move towards right from a cell.
Given a M x N rectangular grid, print all shortest routes in the grid that start at the first cell (0,0) and end at the last cell (N-1,M-1). We can move down or right or diagonally (down-right) but not up or left.
Given a M x N matrix of characters, find the length of longest path in the matrix starting from a given character. All characters in the longest path should be increasing and consecutive to each other in alphabetical order.
Give a M x N binary matrix, replace all occurrences of 0 by 1 which are completely surrounded by 1.