![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
辰出灬子归
这个作者很懒,什么都没留下…
展开
-
LeetCode50 pow(x, n)
原题:英: Implement pow(x, n). 中: 实现 pow(x, n) 函数解题思路:实现幂运算,首先会想到用递归实现,但是要考虑很多种情况,比如x为0,n为0,n是负数,越界了等等。代码如下:public class Solution { public double myPow(double x, int n) { if(x==0){return 0;}原创 2017-07-16 19:29:53 · 287 阅读 · 0 评论 -
LeetCode49 Group Anagrams
原题:英: Given an array of strings, group anagrams together. For example, given: [“eat”, “tea”, “tan”, “ate”, “nat”, “bat”] 中: 给定一个字符串数组,将字母颠倒而成的分组。 例如,给出:[“eat”, “tea”, “tan”, “ate”, “nat”, “bat”]原创 2017-07-06 20:23:27 · 395 阅读 · 0 评论 -
Leetcode48 Rotate Image
原题:英: You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up: Could you do this in-place? 中: 给定一个n×n的二维矩阵表示一个图像。 将图像旋转90度(顺时针)。 跟进:你能做到这一点原创 2017-07-05 21:26:24 · 256 阅读 · 0 评论 -
LeetCode46 Permutations
原题:英: Given a collection of distinct numbers, return all possible permutations. For example, [1,2,3] have the following permutations: 中: 英:给定一组不同的数据,返回所有可能的排列。 例如,1,2,3有以下排列: [ [1,2,3], [1原创 2017-07-03 19:10:17 · 271 阅读 · 0 评论 -
LeetCode47 Permutations II
原题:英: Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example, [1,1,2] have the following unique permutations: 中: 给定一组可能包含重复的数字,返回所有可能的惟一排原创 2017-07-04 16:26:22 · 248 阅读 · 0 评论 -
LeetCode40 Combination Sum II
原题:英: Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each number in C may only be used once in the combina原创 2017-07-02 09:48:58 · 235 阅读 · 0 评论 -
LeetCode39 Combination Sum
原题:英:Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated number may be chosen原创 2017-07-01 21:32:05 · 315 阅读 · 0 评论 -
LeetCode53 Maximum Subarray
原题:英: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,1,-3,4,-1,2,1,-5,4], the contiguous subarray [4,-1,2,1原创 2017-07-17 20:21:55 · 333 阅读 · 0 评论