전체 글 844

[알고리즘] LeetCode 2322 - Minimum Score After Removals on a Tree (C++)

[문제 링크] : https://leetcode.com/problems/minimum-score-after-removals-on-a-tree/description/ Minimum Score After Removals on a Tree - LeetCodeCan you solve this real interview question? Minimum Score After Removals on a Tree - There is an undirected connected tree with n nodes labeled from 0 to n - 1 and n - 1 edges. You are given a 0-indexed integer array nums of length n where nums[i] represenl..

알고리즘 2026.09.21

[알고리즘] LeetCode 1665 - Minimum Initial Energy to Finish Tasks (C++)

[문제 링크] : https://leetcode.com/problems/minimum-initial-energy-to-finish-tasks/description/ Minimum Initial Energy to Finish Tasks - LeetCodeCan you solve this real interview question? Minimum Initial Energy to Finish Tasks - You are given an array tasks where tasks[i] = [actuali, minimumi]: * actuali is the actual amount of energy you spend to finish the ith task. * minimumi is the minimum amol..

알고리즘 2026.09.20

[알고리즘] LeetCode 1931 - Painting a Grid With Three Different Colors (C++)

[문제 링크] : https://leetcode.com/problems/painting-a-grid-with-three-different-colors/description/ Painting a Grid With Three Different Colors - LeetCodeCan you solve this real interview question? Painting a Grid With Three Different Colors - You are given two integers m and n. Consider an m x n grid where each cell is initially white. You can paint each cell red, green, or blue. All cells must be..

알고리즘 2026.09.18

[알고리즘] LeetCode 1948 - Delete Duplicate Folders in System (C++)

[문제 링크] : https://leetcode.com/problems/delete-duplicate-folders-in-system/submissions/2144805629/ Delete Duplicate Folders in System - LeetCodeCan you solve this real interview question? Delete Duplicate Folders in System - Due to a bug, there are many duplicate folders in a file system. You are given a 2D array paths, where paths[i] is an array representing an absolute path to the ith folder i..

알고리즘 2026.09.17

[알고리즘] LeetCode 1611 - Minimum One Bit Operations to Make Integers Zero (C++)

[문제 링크] : https://leetcode.com/problems/minimum-one-bit-operations-to-make-integers-zero/description/ Minimum One Bit Operations to Make Integers Zero - LeetCodeCan you solve this real interview question? Minimum One Bit Operations to Make Integers Zero - Given an integer n, you must transform it into 0 using the following operations any number of times: * Change the rightmost (0th) bit in the b..

알고리즘 2026.09.16

[알고리즘] LeetCode 1526 - Minimum Number of Increments on Subarrays to Form a Target Array (C++)

[문제 링크] : https://leetcode.com/problems/minimum-number-of-increments-on-subarrays-to-form-a-target-array/description/ Minimum Number of Increments on Subarrays to Form a Target Array - LeetCodeCan you solve this real interview question? Minimum Number of Increments on Subarrays to Form a Target Array - You are given an integer array target. You have an integer array initial of the same size as t..

알고리즘 2026.09.15

[알고리즘] LeetCode 2392 - Build a Matrix With Conditions (C++)

[문제 링크] : https://leetcode.com/problems/build-a-matrix-with-conditions/description/ Build a Matrix With Conditions - LeetCodeCan you solve this real interview question? Build a Matrix With Conditions - You are given a positive integer k. You are also given: * a 2D integer array rowConditions of size n where rowConditions[i] = [abovei, belowi], and * a 2D integer array colConditileetcode.com#incl..

알고리즘 2026.09.13