목록leetcode (46)
복's
https://leetcode.com/problems/duplicate-emails/description/ Duplicate Emails - LeetCode Can you solve this real interview question? Duplicate Emails - Table: Person +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | email | varchar | +-------------+---------+ id is the primary key (column with unique val leetcode.com 중복되는 email 컬럼이 있는 경우만 출력하면 되는 문제로 2가지의 풀..
https://leetcode.com/problems/maximum-depth-of-binary-tree/description/ Maximum Depth of Binary Tree - LeetCode Can you solve this real interview question? Maximum Depth of Binary Tree - Given the root of a binary tree, return its maximum depth. A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf leetcode.com 문제 보자마자 DFS로 풀려고 했..
https://leetcode.com/problems/maximum-number-of-balloons/description/ Maximum Number of Balloons - LeetCode Can you solve this real interview question? Maximum Number of Balloons - Given a string text, you want to use the characters of text to form as many instances of the word "balloon" as possible. You can use each character in text at most once. Return the ma leetcode.com 문제를 easy중에서 랜덤으로 뽑았다..
https://leetcode.com/problems/consecutive-numbers/ Consecutive Numbers - LeetCode Can you solve this real interview question? Consecutive Numbers - Table: Logs +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | num | varchar | +-------------+---------+ In SQL, id is the primary key for this table. leetcode.com LAG, LEAD 함수를 통해서 이전 row의 값과 다음 row의 값을 가져와서 문제..
https://leetcode.com/problems/rank-scores/description/ Rank Scores - LeetCode Can you solve this real interview question? Rank Scores - Table: Scores +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | score | decimal | +-------------+---------+ id is the primary key (column with unique values) leetcode.com 음... 진짜 rank 함수만 쓰면 바로 넘어갈 수 있는 문제였다. 습관적으로 맨 처음에는 ..
https://leetcode.com/problems/second-highest-salary/description/ Second Highest Salary - LeetCode Can you solve this real interview question? Second Highest Salary - Table: Employee +-------------+------+ | Column Name | Type | +-------------+------+ | id | int | | salary | int | +-------------+------+ id is the primary key (column with unique values) leetcode.com DB는 Medium 까지는 풀어도되지 않을까 싶어서 풀어..
https://leetcode.com/problems/same-tree/description/ Same Tree - LeetCode Can you solve this real interview question? Same Tree - Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical, and the nodes have the leetcode.com 주어진 트리가 동일한 트리인지 비교하는 문제로 나는 트리를 순회하면서 매번 트리의 노드가 갖는 va..
https://leetcode.com/problems/employees-earning-more-than-their-managers/description/ Employees Earning More Than Their Managers - LeetCode Can you solve this real interview question? Employees Earning More Than Their Managers - Table: Employee +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | name | varchar | | salary | int | | managerId | int | +------ l..
https://leetcode.com/problems/binary-tree-inorder-traversal/ Binary Tree Inorder Traversal - LeetCode Can you solve this real interview question? Binary Tree Inorder Traversal - Given the root of a binary tree, return the inorder traversal of its nodes' values. Example 1: [https://assets.leetcode.com/uploads/2020/09/15/inorder_1.jpg] Input: root = [1,nu leetcode.com 트리가 주어지고 중위 순회하며 요소를 출력하는 문제이..
https://leetcode.com/problems/combine-two-tables/description/ Combine Two Tables - LeetCode Can you solve this real interview question? Combine Two Tables - Table: Person +-------------+---------+ | Column Name | Type | +-------------+---------+ | personId | int | | lastName | varchar | | firstName | varchar | +-------------+---------+ personId i leetcode.com LeetCode에 SQL 문제도 있었다 !!! 진짜 오랜만에 쿼리..