목록행렬 (35)
넘치게 채우기
https://leetcode.com/problems/convert-1d-array-into-2d-array/description/?envType=daily-question&envId=2024-09-01leetcode - Convert 1D Array Into 2D Array문제 유형 : 행렬, 배열, 구현문제 난이도 : Easy 문제You are given a 0-indexed 1-dimensional (1D) integer array original, and two integers, m and n. You are tasked with creating a 2-dimensional (2D) array with m rows and n columns using all the elements from ori..
https://leetcode.com/problems/count-sub-islands/description/?envType=daily-question&envId=2024-08-28leetcode - Count Sub Islands문제 유형 : bfs/dfs, 행렬문제 난이도 : Medium 문제You are given two m x n binary matrices grid1 and grid2 containing only 0's (representing water) and 1's (representing land). An island is a group of 1's connected 4-directionally (horizontal or vertical). Any cells outside of the gr..
https://leetcode.com/problems/magic-squares-in-grid/description/?envType=daily-question&envId=2024-08-09leetcode - Magic Squares In Grid문제 유형 : 행렬문제 난이도 : Medium 문제A 3 x 3 magic square is a 3 x 3 grid filled with distinct numbers from 1 to 9 such that each row, column, and both diagonals all have the same sum.Given a row x col grid of integers, how many 3 x 3 contiguous magic square subgrids are..
https://leetcode.com/problems/spiral-matrix-iii/submissions/1348374879/leetcode - Spiral Matrix III문제 유형 : 행렬, 구현문제 난이도 : Medium 문제You start at the cell (rStart, cStart) of an rows x cols grid facing east. The northwest corner is at the first row and column in the grid, and the southeast corner is at the last row and column.You will walk in a clockwise spiral shape to visit every position in thi..
https://leetcode.com/problems/build-a-matrix-with-conditions/description/leetcode - Build a Matrix With Conditions문제 유형 : 행렬, 위상 정렬문제 난이도 : Hard 문제You are given a positive integer k. You are also given:a 2D integer array rowConditions of size n where rowConditions[i] = [abovei, belowi], anda 2D integer array colConditions of size m where colConditions[i] = [lefti, righti].The two arrays contain ..
https://leetcode.com/problems/find-valid-matrix-given-row-and-column-sums/description/leetcode - Find Valid Matrix Given Row and Column Sums문제 유형 : 그리디, 행렬문제 난이도 : Medium 문제You are given two arrays rowSum and colSum of non-negative integers where rowSum[i] is the sum of the elements in the ith row and colSum[j] is the sum of the elements of the jth column of a 2D matrix. In other words, you do n..
https://leetcode.com/problems/lucky-numbers-in-a-matrix/description/leetcode - Lucky Numbers in a Matrix문제 유형 : 행렬문제 난이도 : Easy 문제Given an m x n matrix of distinct numbers, return all lucky numbers in the matrix in any order.A lucky number is an element of the matrix such that it is the minimum element in its row and maximum in its column. m x n의 행렬이 주어진다.럭키넘버들을 찾아서 반환하시오. 순서는 상관없습니다. 럭키넘버는 한 행에..
https://leetcode.com/problems/score-after-flipping-matrix/description/leetcode - Score After Flipping Matrix문제 유형 : 행렬, 비트마스킹, 그리디문제 난이도 : Medium 문제You are given an m x n binary matrix grid.A move consists of choosing any row or column and toggling each value in that row or column (i.e., changing all 0's to 1's, and all 1's to 0's).Every row of the matrix is interpreted as a binary number, and t..
https://leetcode.com/problems/largest-local-values-in-a-matrix/description/leetcode - Largest Local Values in a Matrix문제 유형 : 행렬, 구현문제 난이도 : Easy 문제You are given an n x n integer matrix grid.Generate an integer matrix maxLocal of size (n - 2) x (n - 2) such that:maxLocal[i][j] is equal to the largest value of the 3 x 3 matrix in grid centered around row i + 1 and column j + 1.In other words, we ..
https://leetcode.com/problems/minimum-falling-path-sum-ii/description/Leetcode - Minimum Falling Path Sum II문제 유형 : 다이나믹 프로그래밍문제 난이도 : Hard 문제Given an n x n integer matrix grid, return the minimum sum of a falling path with non-zero shifts.A falling path with non-zero shifts is a choice of exactly one element from each row of grid such that no two elements chosen in adjacent rows are in the same..