목록분류 전체보기 (943)
넘치게 채우기
https://leetcode.com/problems/uncrossed-lines/ Uncrossed Lines - LeetCode Can you solve this real interview question? Uncrossed Lines - You are given two integer arrays nums1 and nums2. We write the integers of nums1 and nums2 (in the order they are given) on two separate horizontal lines. We may draw connecting lines: a straigh leetcode.com 문제 유형 : 다이나믹 프로그래밍 문제 난이도 : Medium 문제 You are given tw..
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/median-of-two-sorted-arrays/description/ Median of Two Sorted Arrays - LeetCode Can you solve this real interview question? Median of Two Sorted Arrays - Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). Example 1 leetcode.com 문제 유형 : 정렬 문제 난이도 : H..
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/number-of-subsequences-that-satisfy-the-given-sum-condition/ Number of Subsequences That Satisfy the Given Sum Condition - LeetCode Can you solve this real interview question? Number of Subsequences That Satisfy the Given Sum Condition - You are given an array of integers nums and an integer target. Return the number of non-empty subsequences of nums such that the s..
https://leetcode.com/problems/maximum-number-of-vowels-in-a-substring-of-given-length/ Maximum Number of Vowels in a Substring of Given Length - LeetCode Can you solve this real interview question? Maximum Number of Vowels in a Substring of Given Length - Given a string s and an integer k, return the maximum number of vowel letters in any substring of s with length k. Vowel letters in English ar..
투 포인터 말 그대로 두개의 포인터를 사용하는 알고리즘이다. (left, right), (start, end)처럼 주로 이름을 붙인다. 슬라이딩 윈도우 투 포인터와 비슷하나, 두 포인터간의 간격이 일정하다.
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..