摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
Problem: https://leetcode.com/problems/generate-parentheses/ Given n pairs of parentheses, write a function to generate all combinations of well-forme 阅读全文
摘要:
Problem: https://leetcode.com/problems/valid-parentheses/ Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if 阅读全文
摘要:
Problem: https://leetcode.com/problems/next-permutation/ Implement next permutation, which rearranges numbers into the lexicographically next greater 阅读全文
摘要:
题目: 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 阅读全文
摘要:
题目: 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 阅读全文
摘要:
题目: Write a function to find the longest common prefix string amongst an array of strings. 思路: 1.假定第一个是,然后比较、缩减 2.同时比较所有的第i位,直到存在不同或到某字符串末 代码 思路1 c++: 阅读全文