# LeetCode 53. Maximum Subarray

Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.

# LeetCode 52. N-Queens II

LeetCode 52. N-Queens II

# LeetCode 51. N-Queens

The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.
n皇后问题，即要求将n个皇后放置在n*n的棋盘（以下称矩阵）中，使得任意一个皇后都不能攻击其她皇后，皇后能够攻击的位置是皇后所在的一整行，所在的一整列，所在的两条对角线。要求皇后不能互相攻击，即是要求任意一个皇后，她所在位置的行，列，两条对角线没有其他皇后.

n皇后问题，关键是要确定哪些位置可以放置，哪些位置不能放置.

# LeetCode 50. Pow(x,n)

Implement pow(x, n), which calculates x raised to the power n (xn).

pow(x,n)中，我们每次让x自乘一次，n就可以减半，这里要注意奇数的情况，如果n是奇数，需要在结果中自乘一下当前的x，不然会少一次x

# LeetCode 49. Group Anagrams

Given an array of strings, group anagrams together.

# LeetCode 48. Rotate Image

You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).

Note:

You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation.

1–>4–>16–>13–>1
2–>8–>15–>9–>2
3–>12–>14–>5–>3

# LeetCode 47. Permutations II

Given a collection of numbers that might contain duplicates, return all possible unique permutations.此问题同46题思路，条件基本一致，只是给定的数组中可能有重复值，需要去掉.

# LeetCode 46. Permutations

Given a collection of distinct integers, return all possible permutations.写好递归函数的要点是：1.确定递归关系式 2. 确定递归结束条件 3.A问题可以分解成B,C,D···Z几个子问题，假设子问题已经解决，在此情况下来解决A问题

# LeetCode 45. Jump Game II

Description

Given an array of non-negative integers, you are initially positioned at the first index of the array.

Each element in the array represents your maximum jump length at that position.

Your goal is to reach the last index in the minimum number of jumps.

Example: Input: [2,3,1,1,4] Output: 2

Explanation: The minimum number of jumps to reach the last index is 2.

Jump 1 step from index 0 to 1, then 3 steps to the last index.

Note:You can assume that you can always reach the last index.