목록LeetCode (568)
넘치게 채우기
https://leetcode.com/problems/convert-1d-array-into-2d-array/description/?envType=daily-question&envId=2024-09-01leetcode - Convert 1D Array Into 2D Array문제 유형 : 행렬, 배열, 구현문제 난이도 : Easy 문제You are given a 0-indexed 1-dimensional (1D) integer array original, and two integers, m and n. You are tasked with creating a 2-dimensional (2D) array with m rows and n columns using all the elements from ori..
https://leetcode.com/problems/modify-graph-edge-weights/description/?envType=daily-question&envId=2024-08-30leetcode - Modift Graph Edge Weights문제 유형 : 우선순위 큐, 다익스트라, 최단거리문제 난이도 : Hard 문제You are given an undirected weighted connected graph containing n nodes labeled from 0 to n - 1, and an integer array edges where edges[i] = [ai, bi, wi] indicates that there is an edge between nodes ai and bi w..
https://leetcode.com/problems/most-stones-removed-with-same-row-or-column/description/?envType=daily-question&envId=2024-08-29leetcode - Most Stones Removed with Same Row or Column문제 유형 : 유니온-파인드문제 난이도 : Medium 문제On a 2D plane, we place n stones at some integer coordinate points. Each coordinate point may have at most one stone.A stone can be removed if it shares either the same row or the same ..
https://leetcode.com/problems/count-sub-islands/description/?envType=daily-question&envId=2024-08-28leetcode - Count Sub Islands문제 유형 : bfs/dfs, 행렬문제 난이도 : Medium 문제You are given two m x n binary matrices grid1 and grid2 containing only 0's (representing water) and 1's (representing land). An island is a group of 1's connected 4-directionally (horizontal or vertical). Any cells outside of the gr..
https://leetcode.com/problems/path-with-maximum-probability/description/?envType=daily-question&envId=2024-08-27leetcode - Path with Maximum Probability문제 유형 : 최단거리, 다익스트라, bfs, 우선순위 큐, 그래프문제 난이도 : Medium 문제You are given an undirected weighted graph of n nodes (0-indexed), represented by an edge list where edges[i] = [a, b] is an undirected edge connecting the nodes a and b with a probability of..
https://leetcode.com/problems/n-ary-tree-postorder-traversal/description/?envType=daily-question&envId=2024-08-26leetcode - N-ary Tree Postorder Traversal문제 유형 : 트리, dfs, 재귀, 스택문제 난이도 : Easy 문제Given the root of an n-ary tree, return the postorder traversal of its nodes' values.Nary-Tree input serialization is represented in their level order traversal. Each group of children is separated by the ..
https://leetcode.com/problems/binary-tree-postorder-traversal/?envType=daily-question&envId=2024-08-25leetcode - Binary Tree Postorder Traversal문제 유형 : 트리, dfs, 이진트리문제 난이도 : Easy 문제Given the root of a binary tree, return the postorder traversal of its nodes' values. 이진트리의 루트가 주어진다, 노드의 값을 후위순회로 한 값을 반환하시오. 풀이후위순회의 순서는, 왼쪽 서브트리 -> 오른쪽 서브트리 -> 루트의 순서이다.이 순서대로 재귀호출 및 로직 처리를 해주면 된다. 코드C++/** * Defin..
https://leetcode.com/problems/find-the-closest-palindrome/description/?envType=daily-question&envId=2024-08-24leetcode - Find the Closest Palindrome문제 유형 : 팰린드롬, 회문, 문자열 처리문제 난이도 : Hard 문제Given a string n representing an integer, return the closest integer (not including itself), which is a palindrome. If there is a tie, return the smaller one.The closest is defined as the absolute difference mi..
https://leetcode.com/problems/fraction-addition-and-subtraction/description/?envType=daily-question&envId=2024-08-23leetcode - Fraction Addition and Subtraction문제 유형 : 문자열 처리, 수학, 정수론문제 난이도 : Medium 문제Given a string expression representing an expression of fraction addition and subtraction, return the calculation result in string format irreducible fraction. If your final result is an integer, c..
https://leetcode.com/problems/number-complement/description/?envType=daily-question&envId=2024-08-22leetcode - Number Complement문제 유형 : 수학, 비트마스킹문제 난이도 : Easy 문제The complement of an integer is the integer you get when you flip all the 0's to 1's and all the 1's to 0's in its binary representation.For example, The integer 5 is "101" in binary and its complement is "010" which is the integer 2.Giv..