About four months of gap (missing GFG), a new post. Given an M x N matrix, transpose the matrix without auxiliary memory.
Given a binary matrix, print all unique rows of the given matrix.
Given a boolean 2D array, where each row is sorted. Find the row with the maximum number of 1s.
A magic square of order n is an arrangement of n^2 numbers, usually distinct integers, in a square, such that the n numbers in all rows,
Given a sequence of matrices, find the most efficient way to multiply these matrices together.
Given a cost matrix cost and a position (m, n) in cost, write a function that returns cost of minimum cost path to reach (m, n) from (0, 0). Each cell of the matrix represents a cost to traverse through that cell.
Given a boolean matrix mat[M][N] of size M X N, modify it such that if a matrix cell mat[i][j] is 1 (or true) then make all the cells of ith row and jth column as 1.
Given a 2D array, print it in spiral form. See the following examples.
Given an n x n matrix, where every row and column is sorted in increasing order. Given a number x, how to decide whether this x is in the matrix. The designed algorithm should have linear time complexity.
Given an image, how will you turn it by 90 degrees? A vague question. Minimize the browser and try your solution before going further.
Given a binary matrix, find out the maximum size square sub-matrix with all 1s. For example, consider the below binary matrix. We strongly recommend that you click here and practice it, before moving on to the solution. Algorithm: Let the given binary matrix be M[R][C]. The idea of the algorithm is to construct an auxiliary… Read More »