随笔分类 -  LeetCode解题笔记

摘要:一、题目描述http://www.patest.cn/contests/mooc-ds2015spring/01-%E5%A4%8D%E6%9D%82%E5%BA%A61给定K个整数组成的序列{ N1, N2, ..., NK },“连续子列”被定义为{ Ni, Ni+1, ..., Nj },其中... 阅读全文
posted @ 2016-01-24 10:21 面包包包包包包 阅读(619) 评论(0) 推荐(0)
摘要:一、题目Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".Subscribeto see which companies asked this ... 阅读全文
posted @ 2015-11-04 17:15 面包包包包包包 阅读(170) 评论(0) 推荐(0)
摘要:一、题目Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word... 阅读全文
posted @ 2015-11-03 14:30 面包包包包包包 阅读(196) 评论(0) 推荐(0)
摘要:一、题目The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off a... 阅读全文
posted @ 2015-11-03 11:28 面包包包包包包 阅读(153) 评论(0) 推荐(0)
摘要:一、题目Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.二、分析很容易想出O(M*N)的算法,也很容... 阅读全文
posted @ 2015-10-28 11:05 面包包包包包包 阅读(117) 评论(0) 推荐(0)
摘要:一、题目#27Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It does... 阅读全文
posted @ 2015-10-25 17:33 面包包包包包包 阅读(442) 评论(0) 推荐(0)
摘要:括号匹配,栈 阅读全文
posted @ 2015-10-18 11:05 面包包包包包包 阅读(138) 评论(0) 推荐(0)
摘要:去除LinkList中倒数第n个节点,VIM 阅读全文
posted @ 2015-09-23 14:43 面包包包包包包 阅读(135) 评论(0) 推荐(0)
摘要:找list中是否存在a+b+c=0的三个数,若存在,找出所有可能的组合。 阅读全文
posted @ 2015-08-26 22:42 面包包包包包包 阅读(141) 评论(0) 推荐(0)
摘要:寻找最长公共前缀 阅读全文
posted @ 2015-08-26 22:34 面包包包包包包 阅读(152) 评论(0) 推荐(0)
摘要:一、题目Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?二、解析这个还是一个回文题目,是在做完回文数字后做的。这题要判断... 阅读全文
posted @ 2015-08-12 11:59 面包包包包包包 阅读(149) 评论(0) 推荐(0)
摘要:一、题目Write a function to find the longest common prefix string amongst an array of strings.二、解析题目是要找到一个str的list中,所有元素最长的公共前缀。例如she, shanghai, s的公共前缀是s。... 阅读全文
posted @ 2015-08-12 11:09 面包包包包包包 阅读(99) 评论(0) 推荐(0)
摘要:判断一个数字是否是回文数字。 阅读全文
posted @ 2015-08-10 11:13 面包包包包包包 阅读(131) 评论(0) 推荐(0)
摘要:找垂线和X轴组成“容器”所能乘水的最大值,即最大面积。 阅读全文
posted @ 2015-08-03 17:20 面包包包包包包 阅读(145) 评论(0) 推荐(0)
摘要:将字符串中的连续数字输出出来,需要考虑多种情况 阅读全文
posted @ 2015-07-22 00:18 面包包包包包包 阅读(111) 评论(0) 推荐(0)
摘要:整数翻转 阅读全文
posted @ 2015-07-22 00:11 面包包包包包包 阅读(114) 评论(0) 推荐(0)
摘要:将字符串按照Z型表示出后,按行输出字符。 阅读全文
posted @ 2015-07-21 16:59 面包包包包包包 阅读(122) 评论(0) 推荐(0)
摘要:【二分查找,第k大,分治】两个有序的list,长度分别为m和n。用O(log(m+n))时间复杂度,在不合并为一个序列的情况下,找到中位数。 阅读全文
posted @ 2015-07-14 16:41 面包包包包包包 阅读(142) 评论(0) 推荐(0)
摘要:【哈希,字符串】在一个字符串中,找出最长不重复字符子串的长度。 阅读全文
posted @ 2015-07-08 10:37 面包包包包包包 阅读(156) 评论(0) 推荐(0)
摘要:【LinkList, Math】大数相加,链表表示。 阅读全文
posted @ 2015-06-30 16:24 面包包包包包包 阅读(167) 评论(0) 推荐(0)