Write a solution to report the first name, last name, city, and state of each person in the Person table. If the address of a personId is not present
Write a solution to report all the duplicate emails.Note that it's guaranteed that the email field is not NULL.Return the result table in any order.Th
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.You may assume that each inpu
Given an integer x, return true if x is a palindrome, and false otherwise.지겹도록 풀어본 펠린드롬 문제Easy 했다.
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in num
Write a solution to find all customers who never order anything.Return the result table in any order.The result format is in the following example.간단한
Find the names of the customer that are not referred by the customer with id = 2.Return the result table in any order.The result format is in the foll
Write a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string "".42ms 풀이,
Given a string s containing just the characters '(', ')', '{', '}', '\[' and ']', determine if the input string is valid.An input string is valid if:O
Write a solution to find the rank of the scores. The ranking should be calculated according to the following rules:The scores should be ranked from th
Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the
Write an algorithm to determine if a number n is happy.A happy number is a number defined by the following process:Starting with any positive integer,
You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, hei
Write a solution to find all the pairs (actor_id, director_id) where the actor has cooperated with the director at least three times.Return the result
Write a solution to find the people who have the most friends and the most friends number.The test cases are generated so that only one person has the
Given two strings s and t, determine if they are isomorphic.Two strings s and t are isomorphic if the characters in s can be replaced to get t.All occ
Implement a last-in-first-out (LIFO) stack using only two queues. The implemented stack should support all the functions of a normal stack (push, top,
시간초과 발생한 백트래킹문제를 보자마자 백트래킹으로 풀었는데, 시간초과가 났다.답 참조 - 투 포인터답을 만들 때, 3개의 값을 골라야 해서 투 포인터라고 생각을 못했다.Medium인데 어렵네
Write a solution to find all dates Id with higher temperatures compared to its previous dates (yesterday).Return the result table in any order.The res
Write a solution to find the customer_number for the customer who has placed the largest number of orders.The test cases are generated so that exactly
Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen nu
Write a solution to find employees who have the highest salary in each of the departments.Return the result table in any order.The result format is in
Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value.If target is not found i
Write a solution to find the number of times each student attended each exam.Return the result table ordered by student_id and subject_name.The result
Write an SQL query that reports the average experience years of all the employees for each project, rounded to 2 digits.Return the result table in any
Write a solution to report the customer ids from the Customer table that bought all the products in the Product table.Return the result table in any o
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any
You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise).You have to rotate the image in-place, which means
Write a solution to report the distance traveled by each user.Return the result table ordered by travelled_distance in descending order, if two or mor
Write a solution to find the names of all the salespersons who did not have any orders related to the company with the name "RED".Return the result ta
Write a solution to report the movies with an odd-numbered ID and a description that is not "boring".Return the result table ordered by rating in desc
Write a solution to get the names of products that have at least 100 units ordered in February 2020 and their amount.Return the result table in any or
Write a solution to find for each date the number of different products sold and their names.The sold products names for each date should be sorted le
Write a solution to find the percentage of the users registered in each contest rounded to two decimals.Return the result table ordered by percentage
Write a solution to find the IDs of the users who visited without making any transactions and the number of times they made these types of visits.Retu
Write a solution to find managers with at least five direct reports.Return the result table in any order.The result format is in the following example
There is a factory website that has several machines each running the same number of processes. Write a solution to find the average time each machine
Write a solution to report the Capital gain/loss for each stock.The Capital gain/loss of a stock is the total gain or loss after buying and selling th
Write a solution to fix the names so that only the first character is uppercase and the rest are lowercase.Return the result table ordered by user_id.
Write a solution to find the employees who earn more than their managers.Return the result table in any order.The result format is in the following ex
Write an SQL query to find for each month and country, the number of transactions and their total amount, the number of approved transactions and thei
Each node in the tree can be one of three types:"Leaf": if the node is a leaf node."Root": if the node is the root of the tree."Inner": If the node is
Write a solution to find the prices of all products on 2019-08-16. Assume the price of all products before any change is 10.Return the result table in
Given an integer array nums, find the subarray with the largest sum, and return its sum.최대연속부분배열을 찾을 땐 분할 정복 or DP의 풀이를 생각할 수 있다.분할 정복은 O(nlogn)의 시간복잡
Write a solution to report the name and bonus amount of each employee with a bonus less than 1000.Return the result table in any order.The result form
Write a solution to report the IDs of all the employees with missing information. The information of an employee is missing if:The employee's name is
There is a city composed of n x n blocks, where each block contains a single building shaped like a vertical square prism. You are given a 0-indexed n
Given an array of strings words, return the words that can be typed using letters of the alphabet on only one row of American keyboard like the image
Write a solution to report the latest login for all users in the year 2020. Do not include the users who did not login in 2020.Return the result table
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path.
Given a string s, find the length of the longest substring without repeating characters.어렵지 않은데, " "를 처리하는데 애를 먹었다.tmp를 slice하는 방식으로 처리해야 수월하게 해결할 수 있
The confirmation rate of a user is the number of 'confirmed' messages divided by the total number of requested confirmation messages. The confirmation
For this problem, we will consider a manager an employee who has at least 1 other employee reporting to them.Write a solution to report the ids and th
You are given an m x n matrix board containing letters 'X' and 'O', capture regions that are surrounded:Connect: A cell is connected to adjacent cells
Write a solution to report the products that were only sold in the first quarter of 2019. That is, between 2019-01-01 and 2019-03-31 inclusive.Return
You are given an array prices where prices\[i] is the price of a given stock on the ith day.Find the maximum profit you can achieve. You may complete
Temp Body
Write a solution to:Find the name of the user who has rated the greatest number of movies. In case of a tie, return the lexicographically smaller user
A company's executives are interested in seeing who earns the most money in each of the company's departments. A high earner in a department is an emp
문제Given two strings text1 and text2, return the length of their longest common subsequence. If there is no common subsequence, return 0.A subsequence
Given a string s, remove duplicate letters so that every letter appears once and only once. You must make sure your result is the smallest in lexicogr
Given a set of distinct positive integers nums, return the largest subset answer such that every pair (answer\[i], answer\[j]) of elements in this sub
Given a binary array nums, return the maximum length of a contiguous subarray with an equal number of 0 and 1.처음엔 누적합 psum으로 접근했다.답은 맞았지만, 시간적으로 느려서 새
You are given an array of variable pairs equations and an array of real numbers values, where equations\[i] = \[Ai, Bi] and values\[i] represent the e