목록행렬 (11)
넘치게 채우기
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..
https://leetcode.com/problems/find-all-groups-of-farmland/description/ Leetcode - Find All Groups of Farmland 문제 유형 : dfs/bfs, 행렬 문제 난이도 : Medium 문제 You are given a 0-indexed m x n binary matrix land where a 0 represents a hectare of forested land and a 1 represents a hectare of farmland. To keep the land organized, there are designated rectangular areas of hectares that consist entirely of farm..
https://leetcode.com/problems/island-perimeter/description/ LeetCode - Island Perimeter 문제 유형 : 행렬 문제 난이도 : Easy 문제 You are given row x col grid representing a map where grid[i][j] = 1 represents land and grid[i][j] = 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by water, and there is exactly one island (i.e., one or mor..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/uMOkZ/btsC35wTquV/v1jnkCibirzRgKVXtq2Zi1/img.png)
역행렬 역행렬이란, 스칼라 값에서 곱셈에 대한 역원과 유사한 개념으로, 선형방정식의 풀이에서 중요한 역할을 한다. 행렬 A, B가 있고 모두 n x n행렬일 때, AB = BA = I인 행렬 B가 존재하면, A를 가역적(invertible)이라고 한다. 이 경우의 B는 A의 역행렬(inverse matrix)라고 하고, A-1로 나타내는데, AA-1=A-1A=I가 항상 성립한다. 가역적인 행렬, 즉 역행렬이 존재하는 행렬을 정칙행렬(nonsingular matrix)라고하고. 그렇지 않은 행렬을 특이행렬(singular matrix)라고 한다. 역행렬의 성질) (A-1)-1 = A (AB)-1=B-1A-1 역행렬을 구하는 방법 역행렬을 구하는 방법은 3가지가 있다: 한 행렬을 변수로 놓고 곱을 구해서 항..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/dlSyRz/btsCUZKyed9/f6E5GClzdEl6XLx5cQEykk/img.png)
특수한 형태의 행렬들과, 기본 행 연산에 대하여 알아보자. 특수한 행렬 대각행렬 n x n 정방행렬에서 대각선을 제외한 모든 항들이 0인 행렬 D를 대각행렬(diagonal matrix)라고 한다. 대각항과 대각합 정방행렬 A의 주대각선 위의 모든 성분들을 대각항이라고 하고, 각 대각항의 합을 대각합(trace)라고 한다. tr(A) 또는 trace(A)로 표기한다. 행렬의 행과 열 번호가 같은 성분들의 합이다. 정방행렬 A와 B의 크기가 같을 때, 다음의 특성들을 가진다. tr(AT) = tr(A) tr(cA) = ctr(A) tr(A+B) = tr(A) + tr(B) tr(A-B) = tr(A) - tr(B) tr(AB) = tr(BA) 항등행렬과 영행렬 대각행렬이면서 대각선의 항들이 모두 1인 n ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/beilhE/btsC2vU8eJo/JPk9hAMYID2zLcGSBlZrr1/img.png)
행렬은 수 또는 문자를 행과 열에 맞추어 구성한 직사각형 배열이다. m x n행렬 또는 (m, n)행렬이라고 부른다. 이 행렬은 m개의 행(row)와 n개의 열(column)을 가진다. aij를 ij-항이라고 한다. i번째 행과 j번째 열이 만나는 항의 값이다. 행렬의 각 행은 가로의 n순서쌍으로, 각 열은 세로의 m순서쌍으로 볼 수 있다. 가로의 n 순서쌍을 행벡터(row vector), 세로의 m 순서쌍을 열벡터(column vector)라고 한다. 정방행렬 행렬의 행의 개수와 열의 개수가 모두 같은 경우, m=n인 경우가 있는데, 이를 정방행렬(square matrix)라고 한다. n개의 행과 n개의 열을 가지는 행렬을 n차 정방행렬(square matrix of order n)이라고 한다. 행렬의..
https://leetcode.com/problems/number-of-laser-beams-in-a-bank/description/ Number of Laser Beams in a Bank - LeetCode Can you solve this real interview question? Number of Laser Beams in a Bank - Anti-theft security devices are activated inside a bank. You are given a 0-indexed binary string array bank representing the floor plan of the bank, which is an m x n 2D matrix. leetcode.com leetcode - ..
https://leetcode.com/problems/convert-an-array-into-a-2d-array-with-conditions/description/ Convert an Array Into a 2D Array With Conditions - LeetCode Can you solve this real interview question? Convert an Array Into a 2D Array With Conditions - You are given an integer array nums. You need to create a 2D array from nums satisfying the following conditions: * The 2D array should contain only th..