随笔分类 - 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 },其中...
阅读全文
摘要:一、题目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 ...
阅读全文
摘要:一、题目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...
阅读全文
摘要:一、题目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...
阅读全文
摘要:一、题目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)的算法,也很容...
阅读全文
摘要:一、题目#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...
阅读全文
摘要:去除LinkList中倒数第n个节点,VIM
阅读全文
摘要:找list中是否存在a+b+c=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?二、解析这个还是一个回文题目,是在做完回文数字后做的。这题要判断...
阅读全文
摘要:一、题目Write a function to find the longest common prefix string amongst an array of strings.二、解析题目是要找到一个str的list中,所有元素最长的公共前缀。例如she, shanghai, s的公共前缀是s。...
阅读全文
摘要:判断一个数字是否是回文数字。
阅读全文
摘要:找垂线和X轴组成“容器”所能乘水的最大值,即最大面积。
阅读全文
摘要:将字符串中的连续数字输出出来,需要考虑多种情况
阅读全文
摘要:将字符串按照Z型表示出后,按行输出字符。
阅读全文
摘要:【二分查找,第k大,分治】两个有序的list,长度分别为m和n。用O(log(m+n))时间复杂度,在不合并为一个序列的情况下,找到中位数。
阅读全文
摘要:【哈希,字符串】在一个字符串中,找出最长不重复字符子串的长度。
阅读全文
摘要:【LinkList, Math】大数相加,链表表示。
阅读全文
浙公网安备 33010602011771号