목록LeetCode (568)
넘치게 채우기
https://leetcode.com/problems/map-of-highest-peak/description/leetcode - Map of Highest Peak문제 유형: bfs, 행렬문제 난이도: Medium 문제You are given an integer matrix isWater of size m x n that represents a map of land and water cells.If isWater[i][j] == 0, cell (i, j) is a land cell.If isWater[i][j] == 1, cell (i, j) is a water cell.You must assign each cell a height in a way that follows these rules:The h..
https://leetcode.com/problems/grid-game/description/leetcode - Grid Game문제 유형: 부분합, 구간합, 그리디문제 난이도: Medium 문제You are given a 0-indexed 2D array grid of size 2 x n, where grid[r][c] represents the number of points at position (r, c) on the matrix. Two robots are playing a game on this matrix.Both robots initially start at (0, 0) and want to reach (1, n-1). Each robot may only move to the right ((..
https://leetcode.com/problems/first-completely-painted-row-or-column/description/leetcode - First Completely Painted Row or Column문제 유형: 행렬, 구현, 시뮬레이션문제 난이도: Medium 문제You are given a 0-indexed integer array arr, and an m x n integer matrix mat. arr and mat both contain all the integers in the range [1, m * n].Go through each index i in arr starting from index 0 and paint the cell in mat containi..
https://leetcode.com/problems/trapping-rain-water-ii/description/leetcode - Trapping Rain Water II문제 유형: 우선순위 큐, bfs문제 난이도: Hard 문제Given an m x n integer matrix heightMap representing the height of each unit cell in a 2D elevation map, return the volume of water it can trap after raining. m x n의 정수 행렬 heightMap이 주어진다. 이는 2D의 높이 지도를 셀단위로 나타내는데, 비가 오고 난 뒤 물이 고이는 물의 총 양을 구하여라. 풀이처음에는 https://rivero..
https://leetcode.com/problems/minimum-cost-to-make-at-least-one-valid-path-in-a-grid/description/leetcode - Minimum Cost to Make at Least One Valid Path in a Grid문제 유형: 최단 경로, 다익스트라문제 난이도: Hard 문제Given an m x n grid. Each cell of the grid has a sign pointing to the next cell you should visit if you are currently in this cell. The sign of grid[i][j] can be:1 which means go to the cell to the righ..
https://leetcode.com/problems/neighboring-bitwise-xor/description/leetcode - Neighboring Bitwise XOR문제 유형: 비트마스킹, 그리디문제 난이도: Medium 문제A 0-indexed array derived with length n is derived by computing the bitwise XOR (⊕) of adjacent values in a binary array original of length n.Specifically, for each index i in the range [0, n - 1]:If i = n - 1, then derived[i] = original[i] ⊕ original[0].Otherwise..
https://leetcode.com/problems/bitwise-xor-of-all-pairings/description/leetcode - Bitwise XOR of All Pairings문제 유형: 비트마스킹문제 난이도: Medium 문제You are given two 0-indexed arrays, nums1 and nums2, consisting of non-negative integers. There exists another array, nums3, which contains the bitwise XOR of all pairings of integers between nums1 and nums2 (every integer in nums1 is paired with every integer ..
https://leetcode.com/problems/minimize-xor/description/leetcode - Minimize XOR문제 유형: 비트마스킹, 그리디문제 난이도: Medium 문제Given two positive integers num1 and num2, find the positive integer x such that:x has the same number of set bits as num2, andThe value x XOR num1 is minimal.Note that XOR is the bitwise XOR operation.Return the integer x. The test cases are generated such that x is uniquely determine..
https://leetcode.com/problems/find-the-prefix-common-array-of-two-arrays/description/leetcode - Find the Prefix Common Array of Two Arrays문제 유형: 구현, 카운팅, 구간합문제 난이도: Medium 문제You are given two 0-indexed integer permutations A and B of length n.A prefix common array of A and B is an array C such that C[i] is equal to the count of numbers that are present at or before the index i in both A and B.Re..
https://leetcode.com/problems/minimum-length-of-string-after-operations/description/leetcode - Minimum Length of String After Operations문제 유형: 문자열 처리, 그리디문제 난이도: Medium 문제You are given a string s.You can perform the following process on s any number of times:Choose an index i in the string such that there is at least one character to the left of index i that is equal to s[i], and at least one ch..