전체 글 (204) 썸네일형 리스트형 [Leetcode][PrefixSum] Merge Intervals 풀어보기 https://leetcode.com/problems/product-of-array-except-self/submissions/2163925484/ 오늘의 문제는 누적합을 사용하는 문제입니다. 실제로 따지고 보면 합은 아니지만 형태는 그런 방식입니다.각 answer[i]에는 본인 nums[i]를 제외한 나머지 모든 값을 곱한 결과를 저장해야합니다. 문제의 조건은 O(n)의 복잡도를 사용하면서 division operation을 사용하지 않는것입니다.만약 division을 사용할 수 있다면, 모두 곱하고 필요한 값만 나누면 되기 때문에 매우 쉽게 해결할 수 있는데 이 경우를 회피하기 위함인것으로 보입니다. 본인 외의 모든 값을 곱하는 것을 반복한다면 쉽게 결과를 얻을 수 있겠지만 이 경우는 O(n^2.. [Leetcode][Greedy] Merge Intervals 풀어보기 https://leetcode.com/problems/merge-intervals/submissions/ Merge Intervals - LeetCodeCan you solve this real interview question? Merge Intervals - Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the inputleetcode.com간단한 그리디 문제입니다. 일단은 주어지는 2차원 배열이 정렬된 상태는 아니이기에 정.. [LeetCode][Dijkstra] NetworkDelayTime 풀어보기 https://leetcode.com/problems/network-delay-time/submissions/?utm_source=chatgpt.com Network Delay Time - LeetCodeCan you solve this real interview question? Network Delay Time - You are given a network of n nodes, labeled from 1 to n. You are also given times, a list of travel times as directed edges times[i] = (ui, vi, wi), where ui is the source node, vi is the tarleetcode.com 이번 문제는 다익스트라 알고.. [LeetCode][DFS] Find Eventual 어쩌구 풀어보기 https://leetcode.com/problems/find-eventual-safe-states/submissions/2153038558/ Find Eventual Safe States - LeetCodeCan you solve this real interview question? Find Eventual Safe States - There is a directed graph of n nodes with each node labeled from 0 to n - 1. The graph is represented by a 0-indexed 2D integer array graph where graph[i] is an integer array of nodesleetcode.com처음에는 terminal n.. [LeetCode][Union-Find] Redundant Connection 풀어보기 https://leetcode.com/problems/redundant-connection/description/?utm_source=chatgpt.com Redundant Connection - LeetCodeCan you solve this real interview question? Redundant Connection - In this problem, a tree is an undirected graph that is connected and has no cycles. You are given a graph that started as a tree with n nodes labeled from 1 to n, with one additional edge aleetcode.com Union-Find를.. [LeetCode][DP] House Robber 풀어보기 https://leetcode.com/problems/house-robber/description/ House Robber - LeetCodeCan you solve this real interview question? House Robber - You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent holeetcode.com 가장 간단한 형태의 Dynamic Programming 문제입니다.DP문제는 DP임을 파악.. [LeetCode][Topological Sort] Course Schedule 풀어보기 https://leetcode.com/problems/course-schedule/description Course Schedule - LeetCodeCan you solve this real interview question? Course Schedule - There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take coleetcode.com 문제는 위상정렬의 가장 간단한 형태의 문제입니다.위상정렬 문제 자체는 어렵게 나오.. [LeetCode][Graph] Number of Islands 풀어보기 https://leetcode.com/problems/number-of-islands Number of Islands - LeetCodeCan you solve this real interview question? Number of Islands - Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands. An island is surrounded by water and is formed by connecting adjacent lleetcode.com유명한 형태의 2차원 그래프 문제입니다.가장 간단하게 bfs혹은 dfs를 통해서 해결할 수 있습니.. 이전 1 2 3 4 ··· 26 다음