LeetCode
若海音符
愿每一份努力都被赏识!
展开
-
182. Duplicate Emails
Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Email | +----+---------+ | 1 | [email protected] | | 2 | [email protected] | | 3 | [email protected] | +----+---------+ For原创 2016-08-30 09:25:18 · 499 阅读 · 0 评论 -
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 | Na原创 2016-08-30 09:17:27 · 431 阅读 · 0 评论 -
196. Delete Duplicate Emails
Write a SQL query to delete all duplicate email entriesin a table named Person, keeping only unique emails based on its smallest Id. +----+------------------+ | Id | Email | +----+----原创 2016-08-29 22:46:41 · 558 阅读 · 0 评论 -
197. Rising Temperature
Given a Weather table,write a SQL query to find all dates' Ids with higher temperature compared toits previous (yesterday's) dates. +---------+------------+------------------+ | Id(INT) | Date(D原创 2016-08-29 22:45:18 · 466 阅读 · 0 评论 -
leetcode-74. Search a 2D Matrix
74. Search a 2D Matrix My Submissions Question Editorial Solution Total Accepted: 77864 Total Submissions: 230283 Difficulty: Medium Write an efficient algorithm that searches for a原创 2016-05-02 17:59:52 · 335 阅读 · 0 评论 -
leetcode-133. Clone Graph
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. Clone an undirected graph. Each node in the graph contains a label and a list of its neighbor原创 2016-05-01 15:17:03 · 469 阅读 · 0 评论 -
广度优先搜索
130. Surrounded Regions Total Accepted: 52330 Total Submissions: 324643 Difficulty: Medium Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A region is原创 2016-05-01 12:28:17 · 395 阅读 · 0 评论 -
Merge Two Sorted Lists
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.struct ListNode { int val; ListNode *next; ListN原创 2016-03-14 10:48:24 · 252 阅读 · 0 评论 -
Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this in place with原创 2016-03-14 10:45:42 · 271 阅读 · 0 评论 -
Valid Parentheses
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct order, "()" and "()[]{}" are all va原创 2016-03-12 18:50:44 · 295 阅读 · 0 评论 -
Remove Nth Node From End of List
Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the原创 2016-03-12 18:06:07 · 367 阅读 · 0 评论 -
Reverse Integer
Example1: x = 123, return 321 Example2: x = -123, return -321 click to show spoilers. Have you thought about this? Here are some good questions to ask before coding. Bonus points for you if yo原创 2016-03-03 10:20:15 · 274 阅读 · 0 评论 -
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 |原创 2016-08-30 12:47:41 · 384 阅读 · 0 评论