![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
SCUTJcfeng
https://github.com/SCUTJcfeng
展开
-
LeetCode:Two Sum
题目: Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the ...原创 2018-04-18 14:58:58 · 255 阅读 · 0 评论 -
LeetCode:181. Employees Earning More Than Their Managers
题目: The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id.+—-+——-+——–+———–+ | Id | Name | Salary | ManagerId | ...原创 2018-04-19 23:30:12 · 204 阅读 · 0 评论 -
LeetCode:183.Customers Who Never Order
题目: Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL query to find all customers who never order anything.Table: Customers.+—-+——-+ | Id | Name ...原创 2018-04-20 16:27:00 · 157 阅读 · 0 评论 -
LeetCode:197. Rising Temperature
题目: Given a Weather table, write a SQL query to find all dates’ Ids with higher temperature compared to its previous (yesterday’s) dates.+———+——————+——————+ | Id(INT) | RecordDate(DATE) | Temperat...原创 2018-04-20 17:17:55 · 164 阅读 · 0 评论 -
LeetCode:596. Classes More Than 5 Students
题目: There is a table courses with columns: student and classPlease list out all classes which have more than or equal to 5 students.For example, the table:+———+————+ | student | class | ...原创 2018-04-20 17:53:54 · 177 阅读 · 0 评论 -
LeetCode:196. Delete Duplicate Emails
题目: Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id.+—-+——————+ | Id | Email | +—-+——————+ | 1 | ...原创 2018-04-20 21:44:25 · 221 阅读 · 0 评论 -
LeetCode:771. Jewels and Stones
题目: You’re given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know how many of th...原创 2018-04-20 23:24:40 · 327 阅读 · 0 评论 -
LeetCode:626. Exchange Seats
链接: https://leetcode.com/problems/exchange-seats/description/题目: Mary is a teacher in a middle school and she has a table seat storing students’ names and their corresponding seat ids.The column...原创 2018-04-29 10:53:23 · 1096 阅读 · 0 评论 -
LeetCode:804. Unique Morse Code Words
链接: https://leetcode.com/problems/unique-morse-code-words/description/题目: International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follow...原创 2018-04-29 11:33:27 · 276 阅读 · 0 评论 -
LeetCode:175. Combine Two Tables
题目: Table: Person+————-+———+ | Column Name | Type | +————-+———+ | PersonId | int | | FirstName | varchar | | LastName | varchar | +————-+———+ PersonId is the primary key colum...原创 2018-04-19 22:05:12 · 202 阅读 · 0 评论 -
LeetCode:182. Duplicate Emails
题目: Write a SQL query to find all duplicate emails in a table named Person.+—-+———+ | Id | Email | +—-+———+ | 1 | a@b.com | | 2 | c@d.com | | 3 | a@b.com | +—-+———+ For example, your qu...原创 2018-04-19 21:08:44 · 184 阅读 · 0 评论 -
LeetCode:Reverse Linked List(单链表反转)
Question: Reverse a singly linked list.(单链表反转)Answer:(42ms)# Definition for singly-linked list.# class ListNode(object): # def __init__(self, x): # self.val = x # self.next =...原创 2018-04-18 16:27:18 · 257 阅读 · 0 评论 -
LeetCode:Add Two Numbers
题目: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and ret...原创 2018-04-18 22:13:25 · 155 阅读 · 0 评论 -
LeetCode:665. Non-decreasing Array
题目: Given an array with n integers, your task is to check if it could become non-decreasing by modifying at most 1 element.We define an array is non-decreasing if array[i] <= array[i + 1] holds ...原创 2018-04-19 14:07:20 · 145 阅读 · 0 评论 -
LeetCode:657. Judge Route Circle
链接: https://leetcode.com/problems/judge-route-circle/description/题目: Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means ...原创 2018-04-30 15:45:43 · 348 阅读 · 0 评论 -
LeetCode:7. Reverse Integer
题目: Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123 Output: 321Example 2:Input: -123 Output: -321Example 3:Input: 120 Output: 21Note: Assume we are ...原创 2018-04-19 16:18:12 · 140 阅读 · 0 评论 -
LeetCode:176. Second Highest Salary
题目: Write a SQL query to get the second highest salary from the Employee table.+—-+——–+ | Id | Salary | +—-+——–+ | 1 | 100 | | 2 | 200 | | 3 | 300 | +—-+——–+ For example, given t...原创 2018-04-19 17:15:22 · 224 阅读 · 0 评论 -
LeetCode:627. Swap Salary
题目: Given a table salary, such as the one below, that has m=male and f=female values. Swap all f and m values (i.e., change all f values to m and vice versa) with a single update query and no interme...原创 2018-04-19 17:33:00 · 241 阅读 · 0 评论 -
LeetCode:620. Not Boring Movies
题目: X city opened a new cinema, many people would like to go to this cinema. The cinema also gives out a poster indicating the movies’ ratings and descriptions. Please write a SQL query to output mo...原创 2018-04-19 17:49:18 · 205 阅读 · 0 评论 -
LeetCode:461. Hamming Distance
链接: https://leetcode.com/problems/hamming-distance/description/题目:The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two in...原创 2018-04-29 15:22:59 · 298 阅读 · 0 评论