# [easy]Two Sum

## 难度: 简单 标题：Two Sum 求和

Given an array of integers, return indices of the two numbers such that they add up to a specific target.

You may assume that each input would have exactly one solution.

Example:
Given nums = [2, 7, 11, 15], target = 9,

Because nums + nums = 2 + 7 = 9,
return [0, 1].

### 链接

https://leetcode.com/problems/two-sum/

# [easy] Delete Node in a Linked List

## 难度: 简单 标题：Delete Node in a Linked List 删除链表的节点

Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.

Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value 3, the linked list should become 1 -> 2 -> 4 after calling your function.

A->B->C->D

# [medium]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 (2 = 1 + 1); given n = 10, return 36 (10 = 3 + 3 + 4).

Note: You may assume that n is not less than 2 and not larger than 58.

Hint:

There is a simple O(n) solution to this problem.
You may check the breaking results of n ranging from 7 to 10 to discover the regularities.

### 链接

https://leetcode.com/problems/integer-break/

## 难度: 简单 标题：第一个坏版本

You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad.

Suppose you have n versions [1, 2, …, n] and you want to find out the first bad one, which causes all the following ones to be bad.

You are given an API bool isBadVersion(version) which will return whether version is bad. Implement a function to find the first bad version. You should minimize the number of calls to the API.

# [easy] Same Tree

## 难度: 简单 标题：相同二叉树

Given two binary trees, write a function to check if they are equal or not.

Two binary trees are considered equal if they are structurally identical and the nodes have the same value.

### 链接

https://leetcode.com/problems/same-tree/

# [easy]Power of Two

## 难度: 简单 标题：2的冥

Given an integer, write a function to determine if it is a power of two.

### 链接

https://leetcode.com/problems/power-of-two/

# [easy]Move Zeroes

## 难度：简单 标题：移动零

Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-zero elements.

For example, given nums = [0, 1, 0, 3, 12], after calling your function, nums should be [1, 3, 12, 0, 0].

Note:
You must do this in-place without making a copy of the array.
Minimize the total number of operations.

## 代码

### 链接

https://leetcode.com/problems/move-zeroes/

# [easy] Maximum Depth of Binary Tree

## 难度: 简单 标题：二叉树最大深度

Given a binary tree, find its maximum depth.

The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.

### 思路

root == null时深度为0;最大深度为左/右的最大深度+1;

### 链接

https://leetcode.com/problems/maximum-depth-of-binary-tree/