목록C++ (79)
넘치게 채우기
https://leetcode.com/problems/candy/description/?envType=study-plan-v2&envId=top-interview-150 Candy - LeetCode Can you solve this real interview question? Candy - There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings. You are giving candies to these children subjected to the following requirements: * Each leetcode.com 문제 유형 : 그리디 문제 난이..
https://leetcode.com/problems/product-of-array-except-self/?envType=study-plan-v2&envId=top-interview-150 Product of Array Except Self - LeetCode Can you solve this real interview question? Product of Array Except Self - Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i]. The product of any prefix or suffix o..
ios_base::sync_with_stdio(false); cin.tie(null); ios_base::sync_with_stdio(false)는 C++의 iostream과 C의 stdio의 동기화를 끊습니다. 기본적으로 C++의 iostream은 C 스타일의 입출력과 동기화되도록 설계되어 있어서 C스타일의 입출력 함수도 같이 사용되는 경우가 많습니다. 이 동기화 과정에서 속도저하가 발생합니다. cin.tie(null)은 cin과 cout이 동기화되지 않도록 설정합니다. 기본적으로 cin은 cout과 묶여서 작업이 있을 때마다 출력 버퍼를 비우는 작업이 수행되는데, 이 동기화를 막으면 더 빨리 작업이 실행됩니다. 알고리즘 문제를 푸는 데에는 매우 빠르게 활용할 수 있습니다.
https://leetcode.com/problems/peak-index-in-a-mountain-array/description/ Peak Index in a Mountain Array - LeetCode Can you solve this real interview question? Peak Index in a Mountain Array - An array arr a mountain if the following properties hold: * arr.length >= 3 * There exists some i with 0 < i < arr.length - 1 such that: * arr[0] < arr[1] < ... < arr[i - 1] < arr leetcode.com 문제 유형 : 배열 문..
https://leetcode.com/problems/insert-delete-getrandom-o1/description/ Insert Delete GetRandom O(1) - LeetCode Can you solve this real interview question? Insert Delete GetRandom O(1) - Implement the RandomizedSet class: * RandomizedSet() Initializes the RandomizedSet object. * bool insert(int val) Inserts an item val into the set if not present. Returns true if th leetcode.com 문제 유형 : OOP / 배열 문..
https://leetcode.com/problems/powx-n/description/ Pow(x, n) - LeetCode Can you solve this real interview question? Pow(x, n) - Implement pow(x, n) [http://www.cplusplus.com/reference/valarray/pow/], which calculates x raised to the power n (i.e., xn). Example 1: Input: x = 2.00000, n = 10 Output: 1024.00000 Example 2: Inpu leetcode.com 문제 유형 : 수학 문제 난이도 : Medium 문제 Implement pow(x, n), which cal..
https://leetcode.com/problems/h-index/description/?envType=study-plan-v2&envId=top-interview-150 H-Index - LeetCode Can you solve this real interview question? H-Index - Given an array of integers citations where citations[i] is the number of citations a researcher received for their ith paper, return the researcher's h-index. According to the definition of h-index on W leetcode.com 문제 유형 : 배열 문..
https://leetcode.com/problems/ransom-note/description/?envType=study-plan-v2&envId=top-interview-150 Ransom Note - LeetCode Can you solve this real interview question? Ransom Note - Given two strings ransomNote and magazine, return true if ransomNote can be constructed by using the letters from magazine and false otherwise. Each letter in magazine can only be used once in ranso leetcode.com 문제 유..
https://leetcode.com/problems/number-of-longest-increasing-subsequence/description/ Number of Longest Increasing Subsequence - LeetCode Can you solve this real interview question? Number of Longest Increasing Subsequence - Given an integer array nums, return the number of longest increasing subsequences. Notice that the sequence has to be strictly increasing. Example 1: Input: nums = [ leetcode...
https://school.programmers.co.kr/learn/courses/30/lessons/42586 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제 유형 : 스택 / 큐 문제 난이도 : Level 2 문제 프로그래머스 팀에서는 기능 개선 작업을 수행 중입니다. 각 기능은 진도가 100%일 때 서비스에 반영할 수 있습니다. 또, 각 기능의 개발속도는 모두 다르기 때문에 뒤에 있는 기능이 앞에 있는 기능보다 먼저 개발될 수 있고, 이때 뒤에 있는 기능은 앞에 있는 기능이 배포될 때 함께 배포됩니다. 먼저 배포되어야 하는 순서대로 작업의 진도..