Leetcode (16) 썸네일형 리스트형 [LeetCode] 15. 3sum [C/C++] Two Pointer https://leetcode.com/problems/3sum/submissions/ 3Sum - 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 코드 1 class Solution { public: vector threeSum(vector& nums) { set s; int cnt = 0; sort(nums.begin(), nums.end()); for (int i = 0; i [LeetCode] Department Highest Salary [MySQL] https://leetcode.com/problems/department-highest-salary/ Department Highest Salary - 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 D.name AS Department, E.name AS Employee, E.salary FROM Department AS D INNER JOIN Employee AS E ON D.id = E.departmentId WHERE (E.salary, E.d.. LeetCode 181. Employees Earning More Than Their Managers [MySql] https://leetcode.com/problems/employees-earning-more-than-their-managers/ Employees Earning More Than Their Managers - 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 E1.Name AS Employee FROM Employee E1, Employee E2 WHERE E1.managerId IS NOT NULL AND E2.id = E1.manager.. LeetCode 180. Consecutive Numbers [MySql] https://leetcode.com/problems/consecutive-numbers/ Consecutive Numbers - 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 distinct l1.num as ConsecutiveNums from logs l1, logs l2, logs l3 where l1.id + 1 = l2.id and l2.id + 1 = l3.id and l1.num = l2.num and l2.num = l3.num 풀이.. LeetCode 178. Rank Scores [MySql] https://leetcode.com/problems/rank-scores/ Rank Scores - 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 score,DENSE_RANK() OVER (ORDER BY Score DESC) AS 'Rank' from Scores order by score DESC Colored by Color Scripter cs 풀이: 스코어를 역순으로 출력하며 DENSE_RANK() OVER()를 이용하여 요구하는.. LeetCode 1115. Print FooBar Alternately [C++/ promise] https://leetcode.com/problems/print-foobar-alternately/ Print FooBar Alternately - 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 코드 : class FooBar { private: int n; std::promise a, b; // 꼭 출력해줄 것이라 약속한다 public: FooBar(int n) { this->n = n; b.set_value(true); // foo를 먼저 출력해야하므로 b를.. LeetCode 1114. Print in Order [C++/ atomic] https://leetcode.com/problems/print-in-order/ Print in Order - 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 코드 : class Foo { atomic turn = 1; public: Foo() { } void first(function printFirst) { while (turn LeetCode 1114. Print in Order [C++/ promise] https://leetcode.com/problems/print-in-order/ Print in Order - 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 코드: class Foo { promise one, two; public: Foo() { } void first(function printFirst) { printFirst(); one.set_value(); } void second(function printSecond) { one.get_future().. 이전 1 2 다음