일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- docker container
- dsf
- Spark
- 빅데이터를 지탱하는 기술
- 그리디
- SQL
- Dynamic Programming
- airflow webserver
- Pseudo Lab
- 백준온라인저지
- Airflow
- Python
- 백준 온라인 저지
- docker image
- airflow architecture
- BOT
- telegram
- 2023년 목표
- delete join
- 프로그래머스
- terraform
- 데이터 엔지니어
- 알고리즘
- hackerrank
- MySQL
- Data Engineering
- docker
- datacamp
- data_engineer
- leetcode
- Today
- Total
목록leetcode (19)
Lim Seunghyun Space
문제 출처 https://leetcode.com/problems/find-bottom-left-tree-value/solutions/3384697/python3-using-deque-solution/ 문제 풀이 이진 트리가 주어질 때, 트리의 가장 마지막 줄의 가장 왼쪽 값을 반환하는 함수를 작성하는 문제 트리를 BFS처럼 순회하여 마지막 레벨을 찾고 마지막 레벨에서 가장 왼쪽 값을 찾아낸다. Deque를 이용하여 루트부터 읽고 다음 레벨의 노드를 순회하며, 이때 Left 노드와 Right 노드가 있을 때 Right 노드부터 Deque에 추가해야 가장 왼쪽 값을 찾을 수 있다. 나의 풀이(Python3) from collections import deque from typing import Optiona..
문제 출처 https://leetcode.com/problems/capital-gainloss/description/ Capital Gain/Loss - LeetCode Can you solve this real interview question? Capital Gain/Loss - Table: Stocks +---------------+---------+ | Column Name | Type | +---------------+---------+ | stock_name | varchar | | operation | enum | | operation_day | int | | price | int | +------------ leetcode.com 문제 해설 각 stock_name별 Gain 혹은 Loss의..
Source https://leetcode.com/problems/market-analysis-i/ Market Analysis I - LeetCode Can you solve this real interview question? Market Analysis I - Table: Users +----------------+---------+ | Column Name | Type | +----------------+---------+ | user_id | int | | join_date | date | | favorite_brand | varchar | +----------------+---------+ u leetcode.com 문제 2019년도에 주문 이력이 있는 user_id와 join_date 그리고..
Source https://leetcode.com/problems/exchange-seats/description/ Exchange Seats - LeetCode Can you solve this real interview question? Exchange Seats - Table: Seat +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | student | varchar | +-------------+---------+ id is the primary key column for this table. Ea leetcode.com 문제 연속된 두 학생의 ID를 교환하는 쿼리를 작성 마지막 학생의 ..
문제 출처 https://leetcode.com/problems/first-bad-version/ First Bad Version - 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부터 n 까지 n 개의 버전이 주어지고 처음 에러가 발생한 버전을 찾아내면 된다. 해당 버전이 에러인..
문제 출처 https://leetcode.com/problems/valid-perfect-square/ Valid Perfect Square - 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보다 크고 2^31 - 1보다 작은 정수(num)가 어떤 수의 제곱수인지 확인하는 문제 문제 풀이 # source: https://leetcode.com/problems/valid-perfect-square/?envType=study-plan&id=binary-..
문제 출처 https://leetcode.com/problems/peak-index-in-a-mountain-array/ Peak Index in a Mountain Array - 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 문제 해설 주어진 배열(arr)에서 산봉우리에 위치하는 인덱스를 구하는 문제 산봉우리가 위치한 인덱스를 i라고 할 때, 산봉우리를 만족하는 조건으로는 arr[0] < arr[1] < ... < arr[i] arr[-1] < arr[-2] ..
문제 출처 https://leetcode.com/problems/search-insert-position/ Search Insert Position - 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 문제 해설 오름차순으로 정렬된 리스트(nums)에 순서를 유지하면서 정수(target)가 들어갈 수 있는 위치를 찾는 문제 시간 복잡도는 O(log n)가 되도록 코드를 구성 문제 풀이 # source: https://leetcode.com/problems/searc..
문제 출처 https://leetcode.com/problems/guess-number-higher-or-lower/ Guess Number Higher or Lower - 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부터 n까지 숫자들을 주어질 때, guess 함수를 이용해 찾고자 하는 숫자(pick)가 무엇인지 찾는 문제 guess 함수는 이미 정의되어 있고, 숫자를 입력하면 -1, 0, 1 중 하나의 결괏값을 반환 -1: 함수에 입력한 값이 ..
문제 출처 https://leetcode.com/problems/binary-search/ Binary Search - 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 문제 해설 정수로 구성된 리스트(nums)에 정수(target)가 포함되어 있는지 확인하는 문제 nums는 오름차순으로 정렬된 상태 target이 포함되어 있으면 nums에서 target이 위치한 인덱스를 포함되어 있지 않으면 -1을 반환 탐색하는 데 걸리는 시간 복잡도는 O(logN)가 되어야 한..