자료구조 알고리즘

https://school.programmers.co.kr/learn/courses/30/lessons/12939 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 알게된 것 stringstream 을 사용해서 while(ss >> temp) 로 하나씩 뽑을 수 있다는 것. 내 코드 #include #include #include #include using namespace std; string solution(string s) { string answer = ""; long long max = -10000000; long long min = 10000000..
https://leetcode.com/problems/average-selling-price/ Account Login - LeetCode 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 select a.product_id, round(sum(a.price * b.units)/sum(b.units), 2) as average_price from Prices as a left outer join UnitsSold as b on a.product_id = b.product_id an..
https://leetcode.com/problems/unique-orders-and-customers-per-month/ Account Login - LeetCode 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 select date_format(order_date, '%Y-%m') as month, count(distinct order_id) as order_count, count(distinct customer_id) as customer_count from Orders ..
https://leetcode.com/problems/npv-queries/ Account Login - LeetCode 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 select b.id, b.year, IFNULL(a.npv, 0) as npv from NPV as a right outer join Queries as b on a.id = b.id and a.year = b.year
https://leetcode.com/problems/delete-and-earn/ class Solution { public: int deleteAndEarn(vector& nums) { int max_val = *max_element(nums.begin(), nums.end()); vector values(max_val+1, 0); for(int num: nums) { values[num] += num; } int dp[max_val+ 1]; dp[0] = values[0]; dp[1] = max(values[0], values[1]); for(int i = 2; i < max_val + 1; i++) { dp[i] = max(dp[i-2] + values[i], dp[i-1]); } return m..
https://leetcode.com/problems/products-price-for-each-store/ Account Login - LeetCode 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 select product_id, max(case when store = 'store1' then price end) as store1, max(case when store = 'store2' then price end) as store2, max(case when store = ..
https://leetcode.com/problems/all-valid-triplets-that-can-represent-a-country/ Account Login - LeetCode 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 select a.student_name as member_A, b.student_name as member_B, c.student_name as member_C from SchoolA as a, SchoolB as b, SchoolC as c whe..
https://leetcode.com/problems/bank-account-summary-ii/ Bank Account Summary II - LeetCode 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 select name, sum(b.amount) as balance from Users as a left join Transactions as b on a.account = b.account group by b.account having balance > 10000