摘要: Problem: https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ Say you have an array for which the ith element is the price of a given stock 阅读全文
posted @ 2016-06-27 20:06 gavinXing 阅读(99) 评论(0) 推荐(0) 编辑
摘要: Problem: https://leetcode.com/problems/h-index/ Given an array of citations (each citation is a non-negative integer) of a researcher, write a functio 阅读全文
posted @ 2016-06-26 12:06 gavinXing 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Problem: https://leetcode.com/problems/house-robber-ii/ After robbing those houses on that street, the thief has found himself a new place for his thi 阅读全文
posted @ 2016-06-25 21:24 gavinXing 阅读(91) 评论(0) 推荐(0) 编辑
摘要: For me, at the age of 20, it's not late to realize that I should take all my effort to persue my dream, to pave the way for my future. 阅读全文
posted @ 2016-06-22 20:24 gavinXing 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Problem: https://leetcode.com/problems/generate-parentheses/ Given n pairs of parentheses, write a function to generate all combinations of well-forme 阅读全文
posted @ 2016-05-28 23:15 gavinXing 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Problem: https://leetcode.com/problems/valid-parentheses/ Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if 阅读全文
posted @ 2016-05-27 21:32 gavinXing 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Problem: https://leetcode.com/problems/next-permutation/ Implement next permutation, which rearranges numbers into the lexicographically next greater 阅读全文
posted @ 2016-05-26 21:21 gavinXing 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation a 阅读全文
posted @ 2016-04-14 20:39 gavinXing 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 题目: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum 阅读全文
posted @ 2016-03-20 20:09 gavinXing 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 题目: Write a function to find the longest common prefix string amongst an array of strings. 思路: 1.假定第一个是,然后比较、缩减 2.同时比较所有的第i位,直到存在不同或到某字符串末 代码 思路1 c++: 阅读全文
posted @ 2016-03-20 15:00 gavinXing 阅读(109) 评论(0) 推荐(0) 编辑