본문 바로가기

Algorithm/자료구조

(108)
(C++) - LeetCode (easy) 1287. Element Appearing More Than 25% In Sorted Array https://leetcode.com/problems/element-appearing-more-than-25-in-sorted-array/description/ Element Appearing More Than 25% In Sorted Array - LeetCode Can you solve this real interview question? Element Appearing More Than 25% In Sorted Array - Given an integer array sorted in non-decreasing order, there is exactly one integer in the array that occurs more than 25% of the time, return that integer..
(C++) - LeetCode (easy) 1128. Number of Equivalent Domino Pairs https://leetcode.com/problems/number-of-equivalent-domino-pairs/description/ Number of Equivalent Domino Pairs - LeetCode Can you solve this real interview question? Number of Equivalent Domino Pairs - Given a list of dominoes, dominoes[i] = [a, b] is equivalent to dominoes[j] = [c, d] if and only if either (a == c and b == d), or (a == d and b == c) - that is, one domino can leetcode.com 자료구조를 ..
(C++) - LeetCode (easy) 1114. Print in Order https://leetcode.com/problems/print-in-order/ Print in Order - LeetCode Can you solve this real interview question? Print in Order - Suppose we have a class: public class Foo { public void first() { print("first"); } public void second() { print("second"); } public void third() { print("third"); } } The same instance of Foo wi leetcode.com mutex와 condition_variable을 사용해 thread동작을 제어하는 문제였습니다. 📕 ..
(C++) - LeetCode (easy) 1047. Remove All Adjacent Duplicates In String https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string/description/ Remove All Adjacent Duplicates In String - LeetCode Can you solve this real interview question? Remove All Adjacent Duplicates In String - You are given a string s consisting of lowercase English letters. A duplicate removal consists of choosing two adjacent and equal letters and removing them. We repeatedl leetc..
(C++, Rust) - LeetCode (easy) 1013. Partition Array Into Three Parts With Equal Sum https://leetcode.com/problems/sum-of-root-to-leaf-binary-numbers/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 자료구조 순회 문제였습니다. 📕 풀이방법 📔 풀이과정 트리를 직선형태로 순회하며 그 직선 형태의 길별로 값을 더하는 형태이므로 dfs형식으로 순회하는 것이 구현에 편리합니다...
(C++, Rust) - LeetCode (easy) 961. N-Repeated Element in Size 2N Array https://leetcode.com/problems/n-repeated-element-in-size-2n-array/description/ N-Repeated Element in Size 2N Array - LeetCode Can you solve this real interview question? N-Repeated Element in Size 2N Array - You are given an integer array nums with the following properties: * nums.length == 2 * n. * nums contains n + 1 unique elements. * Exactly one element of nums is repeated n leetcode.com 자료구..
(C++, Rust) - LeetCode (easy) 933. Number of Recent Calls https://leetcode.com/problems/number-of-recent-calls/description/ Number of Recent Calls - LeetCode Can you solve this real interview question? Number of Recent Calls - You have a RecentCounter class which counts the number of recent requests within a certain time frame. Implement the RecentCounter class: * RecentCounter() Initializes the counter with ze leetcode.com 자료구조를 이용하거나 이분탐색을 사용해본 문제였습니..
(C++, Rust) - LeetCode (easy) 905. Sort Array By Parity https://leetcode.com/problems/sort-array-by-parity/description/ Sort Array By Parity - LeetCode Can you solve this real interview question? Sort Array By Parity - Given an integer array nums, move all the even integers at the beginning of the array followed by all the odd integers. Return any array that satisfies this condition. Example 1: Input: leetcode.com 자료구조를 사용해보는 문제였습니다. 📕 풀이방법 📔 입력 및 초기..