목록릿코드 (85)
넘치게 채우기
https://leetcode.com/problems/minimum-number-of-vertices-to-reach-all-nodes/description/ Minimum Number of Vertices to Reach All Nodes - LeetCode Can you solve this real interview question? Minimum Number of Vertices to Reach All Nodes - Given a directed acyclic graph, with n vertices numbered from 0 to n-1, and an array edges where edges[i] = [fromi, toi] represents a directed edge from leetcod..
https://leetcode.com/problems/maximum-twin-sum-of-a-linked-list/ Maximum Twin Sum of a Linked List - LeetCode Can you solve this real interview question? Maximum Twin Sum of a Linked List - In a linked list of size n, where n is even, the ith node (0-indexed) of the linked list is known as the twin of the (n-1-i)th node, if 0
https://leetcode.com/problems/solving-questions-with-brainpower/ Solving Questions With Brainpower - LeetCode Can you solve this real interview question? Solving Questions With Brainpower - You are given a 0-indexed 2D integer array questions where questions[i] = [pointsi, brainpoweri]. The array describes the questions of an exam, where you have to process the qu leetcode.com 문제 유형 : 다이나믹 프로그래밍..
https://leetcode.com/problems/spiral-matrix-ii/description/ Spiral Matrix II - LeetCode Can you solve this real interview question? Spiral Matrix II - Given a positive integer n, generate an n x n matrix filled with elements from 1 to n2 in spiral order. Example 1: [https://assets.leetcode.com/uploads/2020/11/13/spiraln.jpg] Input: n = 3 O leetcode.com 문제 유형 : 나선형 행렬 문제 난이도 : Medium 문제 Given a p..
https://leetcode.com/problems/spiral-matrix/description/ Spiral Matrix - LeetCode Can you solve this real interview question? Spiral Matrix - Given an m x n matrix, return all elements of the matrix in spiral order. Example 1: [https://assets.leetcode.com/uploads/2020/11/13/spiral1.jpg] Input: matrix = [[1,2,3],[4,5,6],[7,8,9]] Outpu leetcode.com 문제 유형 : 나선형 매트릭스 난이도 : Medium 문제 Given an m x n m..
https://leetcode.com/problems/matrix-diagonal-sum/description/ Matrix Diagonal Sum - LeetCode Can you solve this real interview question? Matrix Diagonal Sum - Given a square matrix mat, return the sum of the matrix diagonals. Only include the sum of all the elements on the primary diagonal and all the elements on the secondary diagonal that are leetcode.com 문제 유형 : 투 포인터 문제 난이도 : Easy 문제 Given ..
#include // 모든 라이브러리 불러오기 형변환 static_cast(값); #정적 자료형 변환. C++에서 기본으로 제공하는 자료형 안에서 형변환을 해준다. dynamic_cast(값); #동적 자료형 변환. 자식 클래스의 포인터/참조에서 부모 클래스의 포인터/참조로 형변환을 해준다. reinterpret_cast(값); #포인터 형태를 바꿔주는데, 어떤 자료형이든 가능하다. 자료형을 막 변환시킬 수 있다. const_cast(값); #const 성향을 없앨 수 있다. PS에서는 static_cast만 기억하면 된다! stoi(string) #문자열을 int로 변환시켜준다. stoi = string to int stof = string to float stol = string to long sto..
https://leetcode.com/problems/dota2-senate/description/ Dota2 Senate - LeetCode Can you solve this real interview question? Dota2 Senate - In the world of Dota2, there are two parties: the Radiant and the Dire. The Dota2 senate consists of senators coming from two parties. Now the Senate wants to decide on a change in the Dota2 game. leetcode.com 문제 유형 : 그리디 / 큐 / 구현 문제 난이도 : Medium 문제 In the wo..
https://leetcode.com/problems/find-the-difference-of-two-arrays/description/ Find the Difference of Two Arrays - LeetCodeCan you solve this real interview question? Find the Difference of Two Arrays - Given two 0-indexed integer arrays nums1 and nums2, return a list answer of size 2 where: * answer[0] is a list of all distinct integers in nums1 which are not present in nums2leetcode.com문제 유형 : 해..
https://leetcode.com/problems/divide-two-integers/description/ Divide Two Integers - LeetCode Can you solve this real interview question? Divide Two Integers - Given two integers dividend and divisor, divide two integers without using multiplication, division, and mod operator. The integer division should truncate toward zero, which means losing it leetcode.com 문제 유형 : 수학 / 자료형 난이도 : Medium 문제 G..