목록LeetCode (530)
넘치게 채우기
https://leetcode.com/problems/check-if-n-and-its-double-exist/description/leetcode - Check If N and Its Double Exist문제 유형: 투 포인터문제 난이도: Easy 문제Given an array arr of integers, check if there exist two indices i and j such that :i != j0 arr[i] == 2 * arr[j]서로 다른 두 인덱스 i, j에 대해서arr[i] == arr[j] *2가 있으면 true를 반환하시오. 풀이2중for문을 돌면서 서로 다른인덱스이고 2배관계인 쌍이있으면 true를, 아니면 false를 반환해준다.단, 다른인덱스임을 고려를 반드시 해줘야하..
https://leetcode.com/problems/valid-arrangement-of-pairs/description/leetcode - Valid Arrangement of Pairs문제 유형: 그래프, 오일러 경로, 오일러 회로, dfs문제 난이도: Hard 문제You are given a 0-indexed 2D integer array pairs where pairs[i] = [starti, endi]. An arrangement of pairs is valid if for every index i where 1 endi-1 == starti.Return any valid arrangement of pairs.Note: The inputs will be generated such that t..
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..