Skip to main content

48 docs tagged with "Matrix"

View all tags

01 Matrix

This is a solution to the 542. 01 Matrix problem on LeetCode.

Battleships in a Board

Given an `m x n` board where each cell is a battleship 'X' or empty '.', count the number of battleships on the board.

Dungeon Game

Given a 2D array representing a dungeon, return the minimum initial health required for a knight to reach the bottom-right corner.

Find the Grid of Region Average

Calculate the m x n grid result, where result[i][j] is the average intensity of the regions to which image[i][j] belongs, rounded down to the nearest integer.

Lonely Pixel I

Given an m x n picture consisting of black 'B' and white 'W' pixels, return the number of black lonely pixels.

Maximal Square

This document provides a solution where we find the largest square containing only 1's and return its area.

Minimum Path Sum(LeetCode)

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path.

Number of Islands II

Given a 2D grid map of `m` rows and `n` columns initially filled with water, perform `addLand` operations that turn the water at specific positions into land. Return the number of islands after each operation. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically.

Smallest Rectangle Enclosing Black Pixels

Given an image represented by a binary matrix where 0 is a white pixel and 1 is a black pixel, return the area of the smallest rectangle that encloses all black pixels. The black pixels are connected, and the rectangle must be axis-aligned.

Sorted Matrix

This document covers methods to sort elements of a matrix in non-decreasing order in various programming languages.

Spiral Matrix

This document provides a solution to the Spiral Matrix problem, where the goal is to traverse a matrix in spiral order.

Transpose Of Matrix

This tutorial covers the solution to the Transpose of Matrix problem from the GeeksforGeeks.

Unique Paths

This is a solution to the Unique Paths problem on LeetCode.

Unique Paths II(LeetCode)

There is a robot initially located at the top-left corner. The robot tries to move to the bottom-right corner. Return the number of possible unique paths that the robot can take to reach the bottom-right corner.

Word Search II

This document provides a solution to the Word Search II problem, where we need to return all words on the board, given an mXn board of characters and a list of strings words.

Word Search(LeetCode)

Given an m x n grid of characters board and a string word, return true if word exists in the grid.