본문 바로가기

분류 전체보기

(2341)
(C++) - LeetCode (easy) 1154. Day of the Year https://leetcode.com/problems/day-of-the-year/description/ Day of the Year - LeetCode Can you solve this real interview question? Day of the Year - Given a string date representing a Gregorian calendar [https://en.wikipedia.org/wiki/Gregorian_calendar] date formatted as YYYY-MM-DD, return the day number of the year. Example 1: Input: dat leetcode.com 📕 풀이방법 📔 입력 및 초기화 1. 윤년과 평년에 대한 12월의 일자를 배열형태..
(SQL) - LeetCode (easy) 1148. Article Views I https://leetcode.com/problems/article-views-i/description/ Article Views I - LeetCode Can you solve this real interview question? Article Views I - Table: Views +---------------+---------+ | Column Name | Type | +---------------+---------+ | article_id | int | | author_id | int | | viewer_id | int | | view_date | date | +---------------+--- leetcode.com distinct를 사용해 해결한 문제였습니다. 📕 풀이방법 📔 풀이과정 자기..
(SQL) - LeetCode (easy) 1141. User Activity for the Past 30 Days I https://leetcode.com/problems/user-activity-for-the-past-30-days-i/description/ User Activity for the Past 30 Days I - LeetCode Can you solve this real interview question? User Activity for the Past 30 Days I - Table: Activity +---------------+---------+ | Column Name | Type | +---------------+---------+ | user_id | int | | session_id | int | | activity_date | date | | activity_typ leetcode.com ..
(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) 1108. Defanging an IP Address https://leetcode.com/problems/defanging-an-ip-address/description/ Defanging an IP Address - LeetCode Can you solve this real interview question? Defanging an IP Address - Given a valid (IPv4) IP address, return a defanged version of that IP address. A defanged IP address replaces every period "." with "[.]". Example 1: Input: address = "1.1.1.1" Outp leetcode.com 문자열을 다뤄보는 문제였습니다. 📕 풀이방법 📔 입력 및..
(C++) - LeetCode (easy) 1103. Distribute Candies to People https://leetcode.com/problems/distribute-candies-to-people/description/ Distribute Candies to People - LeetCode Can you solve this real interview question? Distribute Candies to People - We distribute some number of candies, to a row of n = num_people people in the following way: We then give 1 candy to the first person, 2 candies to the second person, and so on leetcode.com 구현 문제였습니다. 📕 풀이방법 📔 ..
(C++) - LeetCode (easy) 1089. Duplicate Zeros https://leetcode.com/problems/duplicate-zeros/ Duplicate Zeros - LeetCode Can you solve this real interview question? Duplicate Zeros - Given a fixed-length integer array arr, duplicate each occurrence of zero, shifting the remaining elements to the right. Note that elements beyond the length of the original array are not writte leetcode.com 간단 구현 문제였습니다. 📕 풀이방법 📔 풀이과정 정답 vector 변수 ans와 0을 복사해 넣..