上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 27 下一页
摘要: Length of Last WordGiven a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.I... 阅读全文
posted @ 2014-12-11 16:42 陆草纯 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Spiral Matrix IIGiven an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the... 阅读全文
posted @ 2014-12-11 13:37 陆草纯 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Spiral MatrixGiven a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[... 阅读全文
posted @ 2014-12-11 13:07 陆草纯 阅读(1415) 评论(0) 推荐(0) 编辑
摘要: 给定正整数n,求1,2,3,...,n的全排列解法一:递归,结果并不为字母序排列。void Helper(vector v, int low, int high){ if(low == high) { for(int i = 0; i v(n,0); for(int... 阅读全文
posted @ 2014-12-10 20:43 陆草纯 阅读(337) 评论(0) 推荐(0) 编辑
摘要: Permutation SequenceThe set[1,2,3,…,n]contains a total ofn! unique permutations.By listing and labeling all of the permutations in order,We get the fo... 阅读全文
posted @ 2014-12-10 20:02 陆草纯 阅读(1534) 评论(0) 推荐(0) 编辑
摘要: Rotate ListGiven a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3-... 阅读全文
posted @ 2014-12-10 14:44 陆草纯 阅读(1097) 评论(0) 推荐(0) 编辑
摘要: Unique Paths IIFollow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle an... 阅读全文
posted @ 2014-12-10 13:36 陆草纯 阅读(425) 评论(0) 推荐(0) 编辑
摘要: Unique PathsA robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right a... 阅读全文
posted @ 2014-12-10 13:17 陆草纯 阅读(3067) 评论(0) 推荐(1) 编辑
摘要: Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the fir... 阅读全文
posted @ 2014-12-10 12:54 陆草纯 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Add BinaryGiven two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".先进行对齐操作,然后从右往左逐位相加,注意进位即可。class Solut... 阅读全文
posted @ 2014-12-10 11:29 陆草纯 阅读(2312) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 27 下一页