leetcode
厚积_薄发
梦想还是要有的,万一实现了呢?
Stay hungry, stay foolish. --Steve Jobs
展开
-
基本输入输出
预先不知道输入数据的组数 2. 判题系统的输入输出2.1 对于剑指Offer>这种有函数定义的题目,你只要完成函数,返回相关的值就可以,不需要处理任何输入输出,不要在函数里输出任何东西。2.2 对于传统ACM的OJ模式题目,你的程序需要stdin(标准输入)读取输入,然后stdout(标准输出)来打印结果,举个例子,你可以使用c语言的scanf或者c++的cin来读取输入,然后使用转载 2016-07-30 23:00:35 · 806 阅读 · 0 评论 -
leetcode 176. Second Highest Salary
176. Second Highest Salary QuestionEditorial Solution My SubmissionsTotal Accepted: 21825Total Submissions: 95303Difficulty: EasyWrite a SQL query to get the second原创 2016-08-08 14:35:23 · 1925 阅读 · 0 评论 -
leetcode 196. Delete Duplicate Emails
196. Delete Duplicate Emails QuestionEditorial Solution My SubmissionsTotal Accepted: 15426Total Submissions: 81201Difficulty: EasyWrite a SQL query to delete all d原创 2016-08-08 14:50:04 · 2580 阅读 · 0 评论 -
leetcode 180. Consecutive Numbers
180. Consecutive Numbers QuestionEditorial Solution My SubmissionsTotal Accepted: 10524Total Submissions: 41797Difficulty: MediumWrite a SQL query to find all numbe原创 2016-08-08 15:03:57 · 3405 阅读 · 2 评论 -
leetcode 177. Nth Highest Salary
177. Nth Highest Salary QuestionEditorial Solution My SubmissionsTotal Accepted: 10347Total Submissions: 63667Difficulty: MediumWrite a SQL query to get the nth hig原创 2016-08-08 15:35:47 · 3132 阅读 · 0 评论 -
leetcode 181. Employees Earning More Than Their Managers
181. Employees Earning More Than Their Managers QuestionEditorial Solution My SubmissionsTotal Accepted: 23223Total Submissions: 61926Difficulty: EasyThe Employee t原创 2016-08-08 16:03:11 · 1153 阅读 · 0 评论 -
leetcode 183. Customers Who Never Order
183. Customers Who Never Order QuestionEditorial Solution My SubmissionsTotal Accepted: 21129Total Submissions: 64940Difficulty: EasySuppose that a website contains原创 2016-08-08 16:05:36 · 1543 阅读 · 0 评论 -
leetcode 185. Department Top Three Salaries
185. Department Top Three Salaries QuestionEditorial Solution My SubmissionsTotal Accepted: 7471Total Submissions: 49037Difficulty: HardThe Employee table holds all转载 2016-08-08 16:38:08 · 1664 阅读 · 0 评论 -
awk grep sed正则的对比分析 和 leetcode 193. Valid Phone Numbers awk 正则匹配
193. Valid Phone NumbersQuestionEditorial Solution My SubmissionsTotal Accepted: 6739Total Submissions: 28381Difficulty: EasyGiven a text file file.txt that conta转载 2016-08-08 23:12:07 · 1066 阅读 · 0 评论 -
leetcode 108. Convert Sorted Array to Binary Search Tre 详细分析 和 递归参数确定
108. Convert Sorted Array to Binary Search Tree QuestionEditorial Solution My SubmissionsTotal Accepted: 84430Total Submissions: 218920Difficulty: MediumGiven an arra原创 2016-08-09 00:23:32 · 479 阅读 · 0 评论 -
leetcode 389. Find the Difference 牛人用异或 或者 求和 解决,很简单。
389. Find the Difference QuestionEditorial Solution My SubmissionsTotal Accepted: 7465Total Submissions: 14609Difficulty: EasyGiven two strings s and t which consis原创 2016-08-30 22:45:35 · 943 阅读 · 0 评论 -
leetcode 387. First Unique Character in a String 不同解法
387. First Unique Character in a String QuestionEditorial Solution My SubmissionsTotal Accepted: 10246Total Submissions: 23693Difficulty: EasyGiven a string, find t原创 2016-08-31 21:53:27 · 3464 阅读 · 0 评论 -
leetcode 4. Median of Two Sorted Arrays O(log(m+n))解法
4. Median of Two Sorted Arrays QuestionEditorial Solution My SubmissionsTotal Accepted: 111263Total Submissions: 563486Difficulty: HardThere are two sorted ar原创 2016-09-03 20:21:42 · 2276 阅读 · 0 评论 -
leetcode 197. Rising Temperature
197. Rising Temperature QuestionEditorial Solution My SubmissionsTotal Accepted: 18016Total Submissions: 68688Difficulty: EasyGiven a Weather table, write a SQL que原创 2016-08-08 14:07:03 · 1414 阅读 · 1 评论 -
leetcode 175. Combine Two Tables
175. Combine Two Tables QuestionEditorial Solution My SubmissionsTotal Accepted: 24263Total Submissions: 70650Difficulty: EasyTable: Person+-------------+--------原创 2016-08-08 13:40:47 · 892 阅读 · 0 评论 -
leetcode部分题目(C++)
2016.3.1988. Merge Sorted Array(从尾到头)MySubmissionsQuestionTotalAccepted: 92780 Total Submissions: 310153 Difficulty: EasyGiven two sorted integer arrays nums1 and nums2,merge nums2 into nums原创 2016-07-30 23:01:36 · 1145 阅读 · 0 评论 -
leetcode 344 reverse String ---java--头尾兑换,直到中间
344. Reverse String QuestionEditorial Solution My SubmissionsTotal Accepted: 61433Total Submissions: 104638Difficulty: EasyWrite a function that takes a string as i原创 2016-07-30 23:05:57 · 354 阅读 · 0 评论 -
leetcode 55. Min Stack 如果有新的更小Min,直接在stack里加入一行Min.
55. Min Stack QuestionEditorial Solution My SubmissionsTotal Accepted: 82427Total Submissions: 348648Difficulty: EasyDesign a stack that supports push, pop, top, an原创 2016-07-31 01:26:10 · 422 阅读 · 0 评论 -
leetcode 377 Combination Sum IV 动态规划
377. Combination Sum IV QuestionEditorial Solution My SubmissionsTotal Accepted: 3456Total Submissions: 8922Difficulty: MediumGiven an integer array with all positi原创 2016-08-01 10:07:28 · 1230 阅读 · 0 评论 -
leetcode 144. Binary Tree Preorder Traversal java
144. Binary Tree Preorder Traversal QuestionEditorial Solution My SubmissionsTotal Accepted: 133952Total Submissions: 325480Difficulty: MediumGiven a binary tree, r原创 2016-08-06 16:33:27 · 334 阅读 · 0 评论 -
leetcode 260. Single Number III --> 用hashmap计算出现的次数,注意containsKey获取key,用 get 方法获取值
260. Single Number III QuestionEditorial Solution My SubmissionsTotal Accepted: 42681Total Submissions: 92409Difficulty: MediumGiven an array of numbers nums, in wh原创 2016-08-06 17:02:22 · 1053 阅读 · 0 评论 -
leetcode 168. Excel Sheet Column Title 递归输出,注意倍数是26,不是27
168. Excel Sheet Column Title QuestionEditorial Solution My SubmissionsTotal Accepted: 69541Total Submissions: 304737Difficulty: EasyGiven a positive integer, r原创 2016-08-06 19:16:10 · 589 阅读 · 0 评论 -
leetcode 347. Top K Frequent Elements 将Hashmap统计次数的Entry,放到List<Entry>里面,对list排序后出现结果
347. Top K Frequent Elements QuestionEditorial Solution My SubmissionsTotal Accepted: 24084Total Submissions: 55147Difficulty: MediumGiven a non-empty array of inte原创 2016-08-06 20:41:27 · 898 阅读 · 0 评论 -
leetcode 137. Single Number II -->hashmap
137. Single Number II QuestionEditorial Solution My SubmissionsTotal Accepted: 91816Total Submissions: 237083Difficulty: MediumGiven an array of integers, every ele原创 2016-08-08 09:46:24 · 778 阅读 · 0 评论 -
leetcode 343. Integer Break ->可以证明,拆成的3越多,最后的乘积越大
343. Integer Break QuestionEditorial Solution My SubmissionsTotal Accepted: 21257Total Submissions: 49611Difficulty: MediumGiven a positive integer n, break it into原创 2016-08-08 10:24:16 · 670 阅读 · 0 评论 -
leetcode 28. Implement strStr() 三种解法
28. Implement strStr() QuestionEditorial Solution My SubmissionsTotal Accepted: 119996Total Submissions: 467056Difficulty: EasyImplement strStr().Returns the in原创 2016-08-08 10:34:24 · 4532 阅读 · 0 评论 -
leetcode 22. Generate Parentheses 递归
22. Generate Parentheses QuestionEditorial Solution My SubmissionsTotal Accepted: 99459Total Submissions: 256334Difficulty: MediumGiven n pairs of parentheses, writ原创 2016-08-08 11:21:38 · 515 阅读 · 0 评论 -
Leetcode 101. Symmetric Tree 判断二叉树是否对称,注意写在两个方法中,递归时注意空的判断
Leetcode 101. Symmetric TreeGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric:原创 2016-10-04 22:26:45 · 456 阅读 · 0 评论