Leetcode 16

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 2022.06.03

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 2022.06.03