Matrix | LeetCode Problems

122 Matrix solutions to LeetCode solutions.

Matrix Problems View all solutions →

Valid Sudoku

#36 Medium

Sudoku Solver

#37 Hard

Rotate Image

#48 Medium

Spiral Matrix

#54 Medium

Spiral Matrix II

#59 Medium

Unique Paths II

#63 Medium

Minimum Path Sum

#64 Medium

Set Matrix Zeroes

#73 Medium

Search a 2D Matrix

#74 Medium

Word Search

#79 Medium

Maximal Rectangle

#85 Hard

Surrounded Regions

#130 Medium

Dungeon Game

#174 Hard

Number of Islands

#200 Medium

Word Search II

#212 Hard

Maximal Square

#221 Medium

Search a 2D Matrix II

#240 Medium

Game of Life

#289 Medium

Range Sum Query 2D - Immutable

#304 Medium

Longest Increasing Path in a Matrix

#329 Hard

Max Sum of Rectangle No Larger Than K

#363 Hard

Kth Smallest Element in a Sorted Matrix

#378 Medium

Trapping Rain Water II

#407 Hard

Pacific Atlantic Water Flow

#417 Medium

Battleships in a Board

#419 Medium

Construct Quad Tree

#427 Medium

Island Perimeter

#463 Medium

Diagonal Traverse

#498 Medium

Minesweeper

#529 Medium

01 Matrix

#542 Medium

Reshape the Matrix

#566 Easy

Image Smoother

#661 Easy

Cut Off Trees for Golf Event

#675 Hard

Max Area of Island

#695 Medium

Flood Fill

#733 Easy

Cherry Pickup

#741 Hard

Contain Virus

#749 Hard

Toeplitz Matrix

#766 Easy

Sliding Puzzle

#773 Hard

Swim in Rising Water

#778 Hard

Transform to Chessboard

#782 Hard

Valid Tic-Tac-Toe State

#794 Medium

Bricks Falling When Hit

#803 Hard

Max Increase to Keep City Skyline

#807 Medium

Making A Large Island

#827 Hard

Flipping an Image

#832 Easy

Image Overlap

#835 Medium

Magic Squares In Grid

#840 Medium

Score After Flipping Matrix

#861 Medium

Shortest Path to Get All Keys

#864 Hard

Transpose Matrix

#867 Easy

Projection Area of 3D Shapes

#883 Easy

Spiral Matrix III

#885 Medium

Surface Area of 3D Shapes

#892 Easy

Snakes and Ladders

#909 Medium

Minimum Falling Path Sum

#931 Medium

Shortest Bridge

#934 Medium

Regions Cut By Slashes

#959 Medium

Unique Paths III

#980 Hard

Rotting Oranges

#994 Medium

Available Captures for Rook

#999 Easy

Number of Enclaves

#1020 Medium

Matrix Cells in Distance Order

#1030 Easy

Coloring A Border

#1034 Medium

Flip Columns For Maximum Number of Equal Rows

#1072 Medium

Number of Submatrices That Sum to Target

#1074 Hard

Shortest Path in Binary Matrix

#1091 Medium

Largest 1-Bordered Square

#1139 Medium

As Far from Land as Possible

#1162 Medium

Minimum Moves to Reach Target with Rotations

#1210 Hard

Path with Maximum Gold

#1219 Medium

Queens That Can Attack the King

#1222 Medium

Reconstruct a 2-Row Binary Matrix

#1253 Medium

Number of Closed Islands

#1254 Medium

Shift 2D Grid

#1260 Easy

Minimum Moves to Move a Box to Their Target Location

#1263 Hard

Count Servers that Communicate

#1267 Medium

Find Winner on a Tic Tac Toe Game

#1275 Easy

Count Square Submatrices with All Ones

#1277 Medium

Minimum Number of Flips to Convert Binary Matrix to Zero Matrix

#1284 Hard

Minimum Falling Path Sum II

#1289 Hard

Maximum Side Length of a Square with Sum Less than or Equal to Threshold

#1292 Medium

Shortest Path in a Grid with Obstacles Elimination

#1293 Hard

Number of Paths with Max Score

#1301 Hard

Matrix Block Sum

#1314 Medium

Sort the Matrix Diagonally

#1329 Medium

The K Weakest Rows in a Matrix

#1337 Easy

Maximum Students Taking Exam

#1349 Hard

Count Negative Numbers in a Sorted Matrix

#1351 Easy

Minimum Cost to Make at Least One Valid Path in a Grid

#1368 Hard

Lucky Numbers in a Matrix

#1380 Easy

Check if There is a Valid Path in a Grid

#1391 Medium

Find the Kth Smallest Sum of a Matrix With Sorted Rows

#1439 Hard

Number of Ways of Cutting a Pizza

#1444 Hard

Cherry Pickup II

#1463 Hard

Subrectangle Queries

#1476 Medium

Count Submatrices With All Ones

#1504 Medium

Minimum Swaps to Arrange a Binary Grid

#1536 Medium

Detect Cycles in 2D Grid

#1559 Medium

Minimum Number of Days to Disconnect Island

#1568 Hard

Matrix Diagonal Sum

#1572 Easy

Special Positions in a Binary Matrix

#1582 Easy

Strange Printer II

#1591 Hard

Maximum Non Negative Product in a Matrix

#1594 Medium

Minimum Cost to Connect Two Groups of Points

#1595 Hard

Find Valid Matrix Given Row and Column Sums

#1605 Medium

Path With Minimum Effort

#1631 Medium

Rank Transform of a Matrix

#1632 Hard

Richest Customer Wealth

#1672 Easy

Map of Highest Peak

#1765 Medium

Determine Whether Matrix Can Be Obtained By Rotation

#1886 Easy

Nearest Exit from Entrance in Maze

#1926 Medium

Grid Game

#2017 Medium

Minimum Operations to Make a Uni-Value Grid

#2033 Medium

Equal Row and Column Pairs

#2352 Medium

Difference Between Ones and Zeros in Row and Column

#2482 Medium

Maximum Number of Points From Grid Queries

#2503 Hard

Maximum Number of Fish in a Grid

#2658 Medium

First Completely Painted Row or Column

#2661 Medium

Find Missing and Repeated Values

#2965 Easy

Minimum Operations to Make Columns Strictly Increasing

#3402 Easy

Maximum Sum With at Most K Elements

#3462 Medium