![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode
AC_XXZ
努力了不一定会成功,但不努力肯定会失败
展开
-
343. Integer Break
Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get.For example, given n = 2, return 1原创 2016-04-26 22:17:07 · 546 阅读 · 1 评论 -
338. Counting Bits
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 and return them as an array.Example: For num = 5 you sh原创 2016-04-26 22:19:39 · 581 阅读 · 0 评论 -
11. Container With Most Water
题目:Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two原创 2016-04-26 22:52:36 · 506 阅读 · 0 评论 -
15. 3Sum
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 of zero.Note: Elements in a triplet (a,b,c) must be i原创 2016-04-27 11:22:33 · 498 阅读 · 0 评论 -
16. 3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly原创 2016-04-27 11:42:32 · 539 阅读 · 0 评论 -
18. 4Sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note: Elements in a quad原创 2016-04-27 11:46:20 · 806 阅读 · 0 评论 -
21. Merge Two Sorted Lists
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists./** * Definition for singly-linked list. * struct ListNo原创 2016-04-27 12:05:43 · 564 阅读 · 0 评论 -
22. Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:“((()))”, “(()())”, “(())()”, “()(())”, “()()()”求出所以可能原创 2016-04-27 12:14:23 · 534 阅读 · 0 评论 -
31. Next Permutation
实现“下一个排列”函数,将排列中的数字重新排列成字典序中的下一个更大的排列。如果这样的重新排列是不可能的,它必须重新排列为可能的最低顺序(即升序排序)。重排必须在原地,不分配额外的内存。以下是一些示例,左侧是输入,右侧是输出:1,2,3 → 1,3,2 3,2,1 → 1,2,3 1,1,5 → 1,5,1网上看来一个示例,觉得挺好的,也没必要另外找一个了。6 5 4 8 7 5 1 一开始没原创 2016-04-27 17:22:04 · 624 阅读 · 0 评论