목록전체 글 (1222)
넘치게 채우기
https://leetcode.com/problems/count-zero-request-servers/description/?envType=daily-question&envId=2026-11-06 Count Zero Request Servers - LeetCodeCan you solve this real interview question? Count Zero Request Servers - You are given an integer n denoting the total number of servers and a 2D 0-indexed integer array logs, where logs[i] = [server_id, time] denotes that the server with id server_id..
https://leetcode.com/problems/minimum-moves-to-equal-array-elements-ii/description/?envType=daily-question&envId=2026-11-02 Minimum Moves to Equal Array Elements II - LeetCodeCan you solve this real interview question? Minimum Moves to Equal Array Elements II - Given an integer array nums of size n, return the minimum number of moves required to make all array elements equal. In one move, you ca..
https://leetcode.com/problems/minimum-moves-to-equal-array-elements/description/?envType=daily-question&envId=2026-11-01 Minimum Moves to Equal Array Elements - LeetCodeCan you solve this real interview question? Minimum Moves to Equal Array Elements - Given an integer array nums of size n, return the minimum number of moves required to make all array elements equal. In one move, you can increme..
https://leetcode.com/problems/twisted-mirror-path-count/description/?envType=daily-question&envId=2026-10-31 Twisted Mirror Path Count - LeetCodeCan you solve this real interview question? Twisted Mirror Path Count - Given an m x n binary grid grid where: * grid[i][j] == 0 represents an empty cell, and * grid[i][j] == 1 represents a mirror. A robot starts at the top-left corner of the grid (0, 0..
https://leetcode.com/problems/shortest-path-with-at-most-k-consecutive-identical-characters/description/?envType=daily-question&envId=2026-10-30 Shortest Path With At Most K Consecutive Identical Characters - LeetCodeCan you solve this real interview question? Shortest Path With At Most K Consecutive Identical Characters - You are given an integer n representing the number of nodes in a directed..
https://leetcode.com/problems/palindromic-path-queries-in-a-tree/description/?envType=daily-question&envId=2026-10-29 Palindromic Path Queries in a Tree - LeetCodeCan you solve this real interview question? Palindromic Path Queries in a Tree - You are given an undirected tree with n nodes labeled 0 to n - 1. This is represented by a 2D array edges of length n - 1, where edges[i] = [ui, vi] indic..
트리에서 두 가지 작업을 할 수 있다고 해보자:- change(x, k): x번째 정점의 값을 k로 변경- sumPath(a, b): 정점 a와 b사이의 모든 값을 합침. 즉, sumPath(0, 10) = 1 + 2 + 6 + 8 + 11 = 28이다. (아래 트리에서 정점 왼쪽 위 숫자는 정점의 id, 정점 속 숫자는 값이다.)작업을 하나 처리하는데 나이브한 경우에서 기본적으로 O(n)의 시간복잡도가 걸린다.그러나, N이 10만, 작업을 요청하는 쿼리의 개수 Q가 10만개 이상이라면?즉, O(QN)으로, 시간초과가 걸릴 수 있다.HLD는 이를 최적화해준다.- 검색 쿼리는 O(log^2 N)- 값 수정 쿼리는 O(log N) 핵심 아이디어heavy edge는 서브트리에서 가장 큰 서브트리를 가진 자식..
https://leetcode.com/problems/minimum-xor-path-in-a-grid/description/?envType=daily-question&envId=2026-10-28 Minimum XOR Path in a Grid - LeetCodeCan you solve this real interview question? Minimum XOR Path in a Grid - You are given a 2D integer array grid of size m * n. You start at the top-left cell (0, 0) and want to reach the bottom-right cell (m - 1, n - 1). At each step, you may move eith..
https://leetcode.com/problems/minimum-swaps-to-arrange-a-binary-grid/description/?envType=daily-question&envId=2026-03-02LeetCode - Minimum Swaps to Arrange a Binary Grid문제 유형: 정렬, 그리디문제 난이도: Medium 문제Given an n x n binary grid, in one step you can choose two adjacent rows of the grid and swap them.A grid is said to be valid if all the cells above the main diagonal are zeros.Return the minimum n..
https://leetcode.com/problems/separate-squares-ii/description/?envType=daily-question&envId=2026-01-14LeetCode - Separate Squares II문제 유형: 이진 탐색, 세그먼트 트리, 라인 스위핑문제 난이도: Hard 문제You are given a 2D integer array squares. Each squares[i] = [xi, yi, li] represents the coordinates of the bottom-left point and the side length of a square parallel to the x-axis.Find the minimum y-coordinate value of a h..