전체 글 891

[알고리즘] LeetCode 2642 - Design Graph With Shortest Path Calculator (C++)

[문제 링크] : https://leetcode.com/problems/design-graph-with-shortest-path-calculator/description/ Design Graph With Shortest Path Calculator - LeetCodeCan you solve this real interview question? Design Graph With Shortest Path Calculator - There is a directed weighted graph that consists of n nodes numbered from 0 to n - 1. The edges of the graph are initially represented by the given array edges ..

알고리즘 2026.11.06

[알고리즘] LeetCode 1569 - Number of Ways to Reorder Array to Get Same BST (C++)

[문제 링크] : https://leetcode.com/problems/number-of-ways-to-reorder-array-to-get-same-bst/description/ Number of Ways to Reorder Array to Get Same BST - LeetCodeCan you solve this real interview question? Number of Ways to Reorder Array to Get Same BST - Given an array nums that represents a permutation of integers from 1 to n. We are going to construct a binary search tree (BST) by inserting the ..

알고리즘 2026.11.04

[알고리즘] LeetCode 3812 - Minimum Edge Toggles on a Tree (C++)

[문제 링크] : https://leetcode.com/problems/minimum-edge-toggles-on-a-tree/description/ Minimum Edge Toggles on a Tree - LeetCodeCan you solve this real interview question? Minimum Edge Toggles on a Tree - You are given an undirected tree with n nodes, numbered from 0 to n - 1. It is represented by a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] indicates that thleetcode.com#incl..

알고리즘 2026.11.03

[알고리즘] LeetCode 1203 - Sort Items by Groups Respecting Dependencies (C++)

[문제 링크] : https://leetcode.com/problems/sort-items-by-groups-respecting-dependencies/description/ Sort Items by Groups Respecting Dependencies - LeetCodeCan you solve this real interview question? Sort Items by Groups Respecting Dependencies - There are n items each belonging to zero or one of m groups where group[i] is the group that the i-th item belongs to and it's equal to -1 if the i-th ite..

알고리즘 2026.11.02

[알고리즘] LeetCode 3336 - Find the Number of Subsequences With Equal GCD (C++)

[문제 링크] : https://leetcode.com/problems/find-the-number-of-subsequences-with-equal-gcd/description/ Find the Number of Subsequences With Equal GCD - LeetCodeCan you solve this real interview question? Find the Number of Subsequences With Equal GCD - You are given an integer array nums. Your task is to find the number of pairs of non-empty subsequences (seq1, seq2) of nums that satisfy the follow..

알고리즘 2026.11.01