自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(5)
  • 收藏
  • 关注

原创 [LeetCode]050-Pow(x,n)

题目: Implement pow(x, n). 实现x的n次幂Solution: 类似于二分的方法来优化“x*x*…x“。 要注意的是当n = INT_MIN时,反过来-n会越界,这时候需要pow(x,INT_MIN) * x 即可。代码如下:class Solution {public: double myPow(double x, int n) {

2016-05-07 19:23:11 661

原创 [LeetCode]049-Group Anagrams

题目: Given an array of strings, group anagrams together.For example, given: [“eat”, “tea”, “tan”, “ate”, “nat”, “bat”], Return:[ [“ate”, “eat”,”tea”], [“nat”,”tan”], [“bat”] ]Note:For the re

2016-05-07 16:40:26 555

原创 [LeetCode]048-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?Solution: 其实就是矩阵的旋转,找到规律即可,比较简单,代码如下:class Solution {publ

2016-05-07 16:06:40 425

原创 [LeetCode]047-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: [1,1,2], [1,2,1], and [2,1,1].

2016-05-07 14:54:13 1072

原创 [LeetCode]046-Permutations

题目:Given a collection of distinct numbers, return all possible permutations.For example, [1,2,3] have the following permutations: [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1]. Solutions:

2016-05-06 22:35:08 1312

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除