随笔分类 -  LeetCode

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 14 下一页
摘要:Write a SQL query to get the second highest salary from the Employee table. For example, given the above Employee table, the query should return 200 a 阅读全文
posted @ 2017-10-24 11:52 immjc 阅读(144) 评论(0) 推荐(0)
摘要:Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id. For example, aft 阅读全文
posted @ 2017-10-24 11:46 immjc 阅读(146) 评论(0) 推荐(0)
摘要:There is a table courses with columns: student and class Please list out all classes which have more than or equal to 5 students. For example, the tab 阅读全文
posted @ 2017-10-24 11:34 immjc 阅读(493) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-10-24 11:20 immjc 阅读(145) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-10-24 09:38 immjc 阅读(124) 评论(0) 推荐(0)
摘要:The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id. Given the Em 阅读全文
posted @ 2017-10-23 22:17 immjc 阅读(206) 评论(0) 推荐(0)
摘要:Table: Person Table: Address Write a SQL query for a report that provides the following information for each person in the Person table, regardless if 阅读全文
posted @ 2017-10-23 21:03 immjc 阅读(120) 评论(0) 推荐(0)
摘要:Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette 阅读全文
posted @ 2017-10-17 17:15 immjc 阅读(119) 评论(0) 推荐(0)
摘要:Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l 阅读全文
posted @ 2017-10-17 16:01 immjc 阅读(117) 评论(0) 推荐(0)
摘要:Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in th 阅读全文
posted @ 2017-10-16 18:52 immjc 阅读(866) 评论(0) 推荐(0)
摘要:Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. Your t 阅读全文
posted @ 2017-10-16 17:43 immjc 阅读(779) 评论(0) 推荐(0)
摘要:Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below 阅读全文
posted @ 2017-10-13 22:17 immjc 阅读(167) 评论(0) 推荐(0)
摘要:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the 阅读全文
posted @ 2017-10-13 11:25 immjc 阅读(110) 评论(0) 推荐(0)
摘要:We define the Perfect Number is a positive integer that is equal to the sum of all its positive divisors except itself. Now, given an integer n, write 阅读全文
posted @ 2017-10-13 10:44 immjc 阅读(113) 评论(0) 推荐(0)
摘要:Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consists of lowercase English letters only and the 阅读全文
posted @ 2017-10-12 11:35 immjc 阅读(169) 评论(0) 推荐(0)
摘要:Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) Yo 阅读全文
posted @ 2017-10-10 13:55 immjc 阅读(628) 评论(0) 推荐(0)
摘要:Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen 阅读全文
posted @ 2017-10-10 13:23 immjc 阅读(174) 评论(0) 推荐(0)
摘要:Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values. Example 1: Example 2: 阅读全文
posted @ 2017-10-09 21:41 immjc 阅读(154) 评论(0) 推荐(0)
摘要:Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrenc 阅读全文
posted @ 2017-10-07 16:55 immjc 阅读(184) 评论(0) 推荐(0)
摘要:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. F 阅读全文
posted @ 2017-10-07 16:07 immjc 阅读(122) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 14 下一页