摘要: QuestionGiven two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All occurrenc... 阅读全文
posted @ 2015-09-14 04:43 树獭君 阅读(172) 评论(0) 推荐(0) 编辑
摘要: QuestionGiven a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were insert... 阅读全文
posted @ 2015-09-14 02:10 树獭君 阅读(139) 评论(0) 推荐(0) 编辑
摘要: QuestionGiven an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order... 阅读全文
posted @ 2015-09-12 00:56 树獭君 阅读(141) 评论(0) 推荐(0) 编辑
摘要: QuestionGiven an array of integers and an integerk, find out whether there are two distinct indicesiandjin the array such thatnums[i] = nums[j]and the... 阅读全文
posted @ 2015-09-11 23:26 树獭君 阅读(140) 评论(0) 推荐(0) 编辑
摘要: QuestionGiven an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].SolutionSimilar with Pascal's Triangle. Note... 阅读全文
posted @ 2015-09-11 23:06 树獭君 阅读(212) 评论(0) 推荐(0) 编辑
摘要: QuestionGivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,... 阅读全文
posted @ 2015-09-11 08:47 树獭君 阅读(352) 评论(0) 推荐(0) 编辑
摘要: QuestionGiven a sorted integer array without duplicates, return the summary of its ranges.For example, given[0,1,2,4,5,7], return["0->2","4->5","7"].S... 阅读全文
posted @ 2015-09-11 07:56 树獭君 阅读(148) 评论(0) 推荐(0) 编辑
摘要: QuestionGiven 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 doe... 阅读全文
posted @ 2015-09-11 05:51 树獭君 阅读(126) 评论(0) 推荐(0) 编辑
摘要: QuestionGiven a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra spa... 阅读全文
posted @ 2015-09-11 05:42 树獭君 阅读(140) 评论(0) 推荐(0) 编辑
摘要: QuestionRotate an array ofnelements to the right byksteps.For example, withn= 7 andk= 3, the array[1,2,3,4,5,6,7]is rotated to[5,6,7,1,2,3,4].Solution... 阅读全文
posted @ 2015-09-11 05:19 树獭君 阅读(166) 评论(0) 推荐(0) 编辑