본문 바로가기

알고리즘21

[LeetCode/MSSQL] 262. Trips and Users 문제링크 262. Trips and Users https://leetcode.com/problems/trips-and-users/description/ 기억하면 좋을 것 select request_at day ,round(sum(case when status = 'cancelled_by_driver' or status = 'cancelled_by_client' then 1 else 0 end) / (count(id) * 1.00),2) 'Cancellation Rate' from Trips t where request_at between '2013-10-01' and '2013-10-03' and client_id in (select users_id from Users where banned = 'No'.. 2024. 4. 6.
[LeetCode/MSSQL] 1327. List the Products Ordered in a Period 문제링크 1327. List the Products Ordered in a Period https://leetcode.com/problems/list-the-products-ordered-in-a-period/description/?envType=study-plan-v2&envId=top-sql-50 LeetCode - The World's Leading Online Programming Learning Platform 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 풀이과정 생.. 2024. 1. 28.
[LeetCode/MSSQL] 196. Delete Duplicate Emails 문제링크 196. Delete Duplicate Emails https://leetcode.com/problems/delete-duplicate-emails/description/?envType=study-plan-v2&envId=top-sql-50 LeetCode - The World's Leading Online Programming Learning Platform 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. 테이블 GROUP BY email 로 묶어서.. 2024. 1. 28.
[백준] Javascript의 shift() 사용했을때 시간초과 관계 리스트를 만들때 input에서 shift()를 해서 받아와 만들었는데 시간초과가 났다.. // 연결 관계리스트 만들기 for (let i = 0; i < M; i++) { let [x, y] = input.shift().split(" ").map(Number); graph[x].push(y); graph[y].push(x); } 검색해보니 shift()가 많이 느리다고하네 .. 배열의 끝이 아닌 임의의 위치에서 항목을 삭제하는 것은 큰 대가를 치뤄야 하기 때문입니다. 그래서 index를 지정해서 설정해줬다. // 연결 관계리스트 만들기 for (let i = 0; i < M; i++) { let [x, y] = input[i].split(" ").map(Number); graph[x].push(y).. 2023. 10. 19.