Given a 2D binary matrix filled with 0’s and 1’s, find the largest square containing only 1’s and return its area.
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:
Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2).
Given an integer matrix, find the length of the longest increasing path.
Given a non-empty 2D matrix matrix and an integer k, find the max sum of a rectangle in the matrix such that its sum is no larger than k.
Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix.
Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing only 1’s and return its area.
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.