목록LeetCode (568)
넘치게 채우기
https://leetcode.com/problems/minimum-time-to-visit-a-cell-in-a-grid/description/leetcode - Minimum Time to Visit a Cell in a Grid문제 유형: 최단 경로, 행렬, 그래프문제 난이도: Hard 문제You are given a m x n matrix grid consisting of non-negative integers where grid[row][col] represents the minimum time required to be able to visit the cell (row, col), which means you can visit the cell (row, col) only when the tim..
https://leetcode.com/problems/minimum-obstacle-removal-to-reach-corner/description/leetcode - Minimum Obstacle Removal to Reach Corner문제 유형: 최단경로, 다익스트라, 다이나믹 프로그래밍문제 난이도: Hard 문제You are given a 0-indexed 2D integer array grid of size m x n. Each cell has one of two values:0 represents an empty cell,1 represents an obstacle that may be removed.You can move up, down, left, or right from and to an..
https://leetcode.com/problems/shortest-distance-after-road-addition-queries-i/description/leetcode - Shortest Distance After Road Addition Queries I문제 유형: 최단 경로, 그래프, 다익스트라, 다이나믹 프로그래밍문제 난이도: Medium 문제You are given an integer n and a 2D integer array queries.There are n cities numbered from 0 to n - 1. Initially, there is a unidirectional road from city i to city i + 1 for all 0 queries[i] = [ui..
https://leetcode.com/problems/find-champion-ii/description/leetcode - Find Champion II문제 유형: 그래프문제 난이도: Medium 문제There are n teams numbered from 0 to n - 1 in a tournament; each team is also a node in a DAG.You are given the integer n and a 0-indexed 2D integer array edges of length m representing the DAG, where edges[i] = [ui, vi] indicates that there is a directed edge from team ui to team vi ..
https://leetcode.com/problems/sliding-puzzle/description/leetcode - Sliding Puzzle문제 유형: bfs문제 난이도: Hard 문제On an 2 x 3 board, there are five tiles labeled from 1 to 5, and an empty square represented by 0. A move consists of choosing 0 and a 4-directionally adjacent number and swapping it.The state of the board is solved if and only if the board is [[1,2,3],[4,5,0]].Given the puzzle board board,..
https://leetcode.com/problems/maximum-matrix-sum/description/leetcode - Maximum Matrix Sum문제 유형: 행렬, 그리디문제 난이도: Medium 문제You are given an n x n integer matrix. You can do the following operation any number of times:Choose any two adjacent elements of matrix and multiply each of them by -1.Two elements are considered adjacent if and only if they share a border.Your goal is to maximize the summati..
https://leetcode.com/problems/rotating-the-box/description/leetcode - Rotating the Box문제 유형: 구현, 행렬, 시뮬레이션문제 난이도: Medium 문제You are given an m x n matrix of characters box representing a side-view of a box. Each cell of the box is one of the following:A stone '#'A stationary obstacle '*'Empty '.'The box is rotated 90 degrees clockwise, causing some of the stones to fall due to gravity. Each stone..
https://leetcode.com/problems/flip-columns-for-maximum-number-of-equal-rows/description/leetcode - Flip Columns For Maximum Number of Equal Rows문제 유형: 비트마스킹, 행렬문제 난이도: Medium 문제You are given an m x n binary matrix matrix.You can choose any number of columns in the matrix and flip every cell in that column (i.e., Change the value of the cell from 0 to 1 or vice versa).Return the maximum number of..
https://leetcode.com/problems/count-unguarded-cells-in-the-grid/description/leetcode - Count Unguarded Cells in the Grid문제 유형: 행렬, 완전 탐색문제 난이도: Medium 문제You are given two integers m and n representing a 0-indexed m x n grid. You are also given two 2D integer arrays guards and walls where guards[i] = [rowi, coli] and walls[j] = [rowj, colj] represent the positions of the ith guard and jth wall re..
https://leetcode.com/problems/take-k-of-each-character-from-left-and-right/description/?envType=daily-question&envId=2024-11-20leetcode - Take K of Each Character From Left and Right문제 유형: 슬라이딩 윈도우문제 난이도: Medium 문제You are given a string s consisting of the characters 'a', 'b', and 'c' and a non-negative integer k. Each minute, you may take either the leftmost character of s, or the rightmost cha..