목록 code review (147)
KEEP GOING

[자기방으로 돌아가기] https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWNcJ2sapZMDFAV8&categoryId=AWNcJ2sapZMDFAV8&categoryType=CODE SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 1. 틀린 풀이 for tc in range(1, int(input()) + 1): time = 1 n = int(input()) # 방번호 담을 배열 route = [] for _ in range(n): a, b = map(int, input().split()) # 출발번호 > 도착번호인 경우..
https://swexpertacademy.com/main/learn/course/lectureProblemViewer.do SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 1. 코드 구현 (난이도 중하) from collections import deque for tc in range(1, int(input())+1): result = 0 n = int(input()) time = [tuple(map(int, input().split())) for _ in range(n)] # 일찍 칼퇴하는 순으로 정렬, 칼퇴 시간이 같을 경우 시작 시간을 정렬 time.sort(key=lambda x:(x[1], x[0])..

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 1. 코드 구현 (CTE 사용) WITH TMP AS( SELECT id ,num ,LAG(num, 1, NULL) OVER(ORDER BY id)AS num2 ,LAG(num, 2, NULL) OVER(ORDER BY id)AS num3 FROM Logs ) SELECT DISTINCT..

https://leetcode.com/problems/longest-substring-without-repeating-characters/ Longest Substring Without Repeating Characters - 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: def lengthOfLongestSubstring(self, s: str) -> int: n = len(s) maxLen =..
https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PobmqAPoDFAUq&categoryId=AV5PobmqAPoDFAUq&categoryType=CODE&problemTitle=&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=&pageSize=10&pageIndex=1 SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 1. 코드 구현 # 동 남 서 북 dx = [0,1,0,-1] dy = [1,0,-1,0] def turn(position): if position =..

https://leetcode.com/problems/department-top-three-salaries/ Department Top Three Salaries - 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. 코드 구현 (CTE 사용) WITH tmp AS( SELECT id ,name ,salary ,departmentId ,DENSE_RANK() OVER(PARTITION BY departmentId ORDER BY salary DESC)AS 'de..

https://www.hackerrank.com/challenges/challenges/problem Challenges | HackerRank Print the total number of challenges created by hackers. www.hackerrank.com 1. 성공한 코드 SELECT Hackers.hacker_id , name , COUNT(challenge_id) challenges_created FROM Hackers INNER JOIN Challenges ON Hackers.hacker_id = Challenges.hacker_id GROUP BY hacker_id, name HAVING challenges_created = ( SELECT MAX(tmp1.challeng..

https://leetcode.com/problems/zigzag-conversion/ Zigzag Conversion - 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. 성공한 코드 from math import ceil class Solution: def convert(self, s: str, numRows: int) -> str: arr = [[] for _ in range(numRows)] n = len(s) gap = numRows*2 -2 p1 =..