본문 바로가기

Algorithm/Implementation

(517)
(C++) - LeetCode (easy) 1189. Maximum Number of Balloons https://leetcode.com/problems/maximum-number-of-balloons/description/ Maximum Number of Balloons - LeetCode Can you solve this real interview question? Maximum Number of Balloons - Given a string text, you want to use the characters of text to form as many instances of the word "balloon" as possible. You can use each character in text at most once. Return the ma leetcode.com 문자열과 자료구조를 다룬 문제였습니다..
(C++) - LeetCode (easy) 1184. Distance Between Bus Stops https://leetcode.com/problems/distance-between-bus-stops/description/ Distance Between Bus Stops - LeetCode Can you solve this real interview question? Distance Between Bus Stops - A bus has n stops numbered from 0 to n - 1 that form a circle. We know the distance between all pairs of neighboring stops where distance[i] is the distance between the stops number leetcode.com 간단 구현 문제였습니다. 📕 풀이방법 📔..
(C++) - LeetCode (easy) 1175. Prime Arrangements https://leetcode.com/problems/prime-arrangements/description/ Prime Arrangements - LeetCode Can you solve this real interview question? Prime Arrangements - Return the number of permutations of 1 to n so that prime numbers are at prime indices (1-indexed.) (Recall that an integer is prime if and only if it is greater than 1, and cannot be writte leetcode.com 소수를 판별해 순열을 구하는 문제였습니다. 📕 풀이방법 📔 풀이과정..
(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월의 일자를 배열형태..
(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을 복사해 넣..
(SQL) - LeetCode (easy) 1068. Product Sales Analysis I https://leetcode.com/problems/product-sales-analysis-i/ Product Sales Analysis I - LeetCode Can you solve this real interview question? Product Sales Analysis I - Table: Sales +-------------+-------+ | Column Name | Type | +-------------+-------+ | sale_id | int | | product_id | int | | year | int | | quantity | int | | price | int | +----------- leetcode.com join을 사용해보는 문제였습니다. 📕 풀이방법 📔 풀이과정 1...
(C++) - LeetCode (easy) 1046. Last Stone Weight https://leetcode.com/problems/last-stone-weight/description/ Last Stone Weight - LeetCode Can you solve this real interview question? Last Stone Weight - You are given an array of integers stones where stones[i] is the weight of the ith stone. We are playing a game with the stones. On each turn, we choose the heaviest two stones and smash them leetcode.com simulation 문제였습니다. 📕 풀이방법 📔 풀이과정 stones..