摘要:Description: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1]. Note:Could you optimize your al
阅读全文
摘要:Description: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return 第二种想法:第i行有i个数;每次往最前面插入一个1,那么除了头尾以外,
阅读全文
摘要:Description: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2
阅读全文
摘要:Description: Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for anothe
阅读全文
摘要:description: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should
阅读全文
摘要:description: Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If
阅读全文
摘要:description: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement
阅读全文
摘要:description: Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed? Would this affect the run-time complexity? How and why? Su
阅读全文
摘要:Description: Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example,[1,1,2] have the follow
阅读全文
摘要:Description: Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the following permutations: [ [1,2,3],
阅读全文
摘要:Description: Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums t
阅读全文
摘要:Descirption: Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate
阅读全文
摘要:description: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate e
阅读全文
摘要:Description: Write a function to find the longest common prefix string amongst an array of strings. Thoughts: 1.定义一个结果字符串result=""; 2.如果List的长度为0,那么直接
阅读全文
摘要:problem description: given a sorted aescend array,return the begining and ending position of the target num i.e: [1,2,3,8,8,9] return [3,4] of course,
阅读全文
摘要:descripte problem: there is an array,at the first it is sorted,but for som reason, it was rotated at some pivot unknown to you beforehand.then you sho
阅读全文
摘要:problem description: there is four number list named A,B,C,D; now you should out put the num of tuples which statisfy A[i] +B[j]+C[k]+D[l] =0 i.e: 以上的
阅读全文
摘要:problem description: remove the nth node from the end of the list for example: given: 1->2->3 n = 1 return: 1->2 thought: first:you should know the le
阅读全文
摘要:problem description: this is the addition about the 3sum,you can use the method of solve the 3sum. given a integer and the target,you should return th
阅读全文