목록 code review (147)
KEEP GOING
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/2GkdL/btrouccsh3X/mBsNqqRDk4UKpOjIgF5cc1/img.jpg)
https://www.hackerrank.com/challenges/binary-search-tree-1/problem Binary Tree Nodes | HackerRank Write a query to find the node type of BST ordered by the value of the node. www.hackerrank.com 1. 틀린 코드 SELECT N ,(CASE WHEN P IS NULL THEN 'Root', # 문제1 다중 조건 처리시 ',' 사용 안함 WHEN N IN (SELECT P FROM BST) THEN 'Inner' ELSE 'Leaf' )END AS 'NAME' # 문제2 END 처리 후 소괄호 처리해야 함 FROM BST ORDER BY N ASC 2. 정답..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/EcWAi/btrosxheJGM/uaqNpw8IZKIrKCQDj3JmY1/img.jpg)
https://www.hackerrank.com/challenges/placements/problem Placements | HackerRank Write a query to output the names of those students whose best friends got offered a higher salary than them. www.hackerrank.com 1. 정답 코드 SELECT S.Name FROM Friends F INNER JOIN Students S ON S.ID = F.ID INNER JOIN Packages P ON F.ID = P.ID INNER JOIN Packages PP ON F.Friend_ID = PP.ID WHERE P.Salary < PP.Salary ORD..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/5WICz/btroxBh9pQ3/xVUhNzKKzdVyVONDKxsZz0/img.jpg)
https://www.hackerrank.com/challenges/full-score/problem Top Competitors | HackerRank Query a list of top-scoring hackers. www.hackerrank.com 문제 접근 방식 Submissions 테이블과 Challenges 테이블을 조인하여 각 챌린지에 대한 difficulty_level 값을 가져온다. 가져온 difficuly_level 컬럼을 이용하여 Difficulty 테이블과 조인하여 문제해서 의미하는 full score 값인 Diffuculty 테이블의 score 값을 가져온다. 이 테이블에서 score 값과 full score 값이 같은 튜플들을 필터링하면 챌린지에서 full score을 맞은 해커..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/dkiAGV/btrosvJvMPZ/IT60T8kOVjJb2CmSPA1FFk/img.jpg)
https://www.hackerrank.com/challenges/weather-observation-station-11/problem Weather Observation Station 11 | HackerRank Query a list of CITY names not starting or ending with vowels. www.hackerrank.com Query the list of CITY names from STATION that either do not start with vowels or do not end with vowels. Your result cannot contain duplicates. Input Format The STATION table is described as fol..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/cNVfdu/btrorPAWBUN/d5LDnznHDuUt4mvKaKK3F1/img.png)
https://www.hackerrank.com/challenges/the-company/problem New Companies | HackerRank Find total number of employees. www.hackerrank.com Amber's conglomerate corporation just acquired some new companies. Each of the companies follows this hierarchy: Given the table schemas below, write a query to print the company_code, founder name, total number of lead managers, total number of senior managers,..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/4iCL2/btrorOJjf3j/IGBKK0fR970v6ETko1ooi1/img.png)
https://leetcode.com/problems/combine-two-tables/submissions/ Combine Two Tables - 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 Table: Person +-------------+---------+ | Column Name | Type | +-------------+---------+ | personId | int | | lastName | varchar | | firstName | varcha..
https://programmers.co.kr/learn/courses/30/lessons/43165 코딩테스트 연습 - 타겟 넘버 n개의 음이 아닌 정수가 있습니다. 이 수를 적절히 더하거나 빼서 타겟 넘버를 만들려고 합니다. 예를 들어 [1, 1, 1, 1, 1]로 숫자 3을 만들려면 다음 다섯 방법을 쓸 수 있습니다. -1+1+1+1+1 = 3 +1-1+1+1+ programmers.co.kr 타겟 넘버 문제 설명 n개의 음이 아닌 정수가 있습니다. 이 수를 적절히 더하거나 빼서 타겟 넘버를 만들려고 합니다. 예를 들어 [1, 1, 1, 1, 1]로 숫자 3을 만들려면 다음 다섯 방법을 쓸 수 있습니다. -1+1+1+1+1 = 3 +1-1+1+1+1 = 3 +1+1-1+1+1 = 3 +1+1+1-1..
f(0) = 1, f(1) = 1 f(n) = f(n-1)+f(n-2) 위와 같은 조건을 만족하는 피보나치 수열이 있다고 가정하자. 위 공식을 통해 음수 또한 피보나치 수열을 만들 수 있다. 예를들어, f(1) = f(0) + f(-1) f(-1) = f(1) - f(0) = 1을 구할 수 있다. 입력된 숫자 번호에 해당하는 피보나치 수열을 문자열로 리턴하는 음수 피보나치 수열을 구현하라. # 메모이제이션 사용 #타겟 원소 lst = [-5,-1,-10,-3,5,10,2] box = [0]*100 box[1] = 1 minusBox = [0]*100 minusBox[-1] = 1 def fibo(n): for i in range(2, n+1): if box[i] != 0: continue else: bo..