diff --git a/DataStructureAndAlgorithm/05 Leetcode同步练习(一).md b/DataStructureAndAlgorithm/05 Leetcode同步练习(一).md
new file mode 100644
index 0000000..561b9dc
--- /dev/null
+++ b/DataStructureAndAlgorithm/05 Leetcode同步练习(一).md
@@ -0,0 +1,791 @@
+
+# Leetcodeͬϰһ
+
+## Ŀ01֮
+
+> - ţ1
+> - Ѷȣ
+> - https://leetcode-cn.com/problems/two-sum/
+
+һ `nums` һĿֵ `target`ڸҳΪĿֵ ǵ±ꡣ
+
+ԼÿֻӦһ𰸡ǣ㲻ظͬԪء
+
+**ʾ1:**
+
+```c
+ nums = [2, 7, 11, 15], target = 9
+
+Ϊ nums[0] + nums[1] = 2 + 7 = 9Է [0, 1]
+```
+
+**ʾ2**
+
+```c
+ nums = [230, 863, 916, 585, 981, 404, 316, 785, 88, 12, 70, 435, 384, 778, 887, 755, 740, 337, 86, 92, 325, 422, 815, 650, 920, 125, 277, 336, 221, 847, 168, 23, 677, 61, 400, 136, 874, 363, 394, 199, 863, 997, 794, 587, 124, 321, 212, 957, 764, 173, 314, 422, 927, 783, 930, 282, 306, 506, 44, 926, 691, 568, 68, 730, 933, 737, 531, 180, 414, 751, 28, 546, 60, 371, 493, 370, 527, 387, 43, 541, 13, 457, 328, 227, 652, 365, 430, 803, 59, 858, 538, 427, 583, 368, 375, 173, 809, 896, 370, 789], target = 542
+
+Ϊ nums[28] + nums[45] = 221 + 321 = 542Է [28, 45]
+```
+
+**ο룺**
+
+˼·ֱñƥ㷨
+
+- ִнͨ
+- ִʱ432 ms, C# ύл 65.82% û
+- ڴģ30.8 MB, C# ύл 8.67% û
+
+```c
+public class Solution
+{
+ public int[] TwoSum(int[] nums, int target)
+ {
+ int[] result = new int[2];
+ for (int i = 0; i < nums.Length - 1; i++)
+ {
+ int find = target - nums[i];
+ for (int j = i + 1; j < nums.Length; j++)
+ {
+ if (find == nums[j])
+ {
+ result[0] = i;
+ result[1] = j;
+ return result;
+ }
+ }
+ }
+ return result;
+ }
+}
+```
+
+
+---
+## Ŀ02ɾеظ
+
+> - ţ26
+> - Ѷȣ
+> - https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/
+
+һ ****Ҫ **ԭ** ɾظֵԪأʹÿԪֻһΣƳ³ȡ
+
+Ҫʹöռ䣬 **ԭ** ʹ O(1) ռɡ
+
+ʾ 1:
+
+```c
+ nums = [1,1,2],
+Ӧ÷µij 2, ԭ nums ǰԪرΪ 1, 2
+㲻Ҫг³ȺԪء
+```
+
+ʾ 2:
+
+```c
+ nums = [0,0,1,1,1,2,2,3,3,4],
+Ӧ÷µij 5, ԭ nums ǰԪرΪ 0, 1, 2, 3, 4
+㲻Ҫг³ȺԪء
+```
+
+˵:
+
+ΪʲôֵĴ?
+
+ע⣬ԡ****ʽݵģζںڵǿɼġ
+
+ڲ:
+
+```c
+// nums ԡáʽݵġҲ˵ʵκο
+int len = removeDuplicates(nums);
+
+// ںڵǿɼġ
+// ĺصij, ӡиóȷΧڵԪء
+for (int i = 0; i < len; i++) {
+ print(nums[i]);
+}
+```
+
+
+
+**ο룺**
+
+˼·˫һһ`j``i``nums[j] == nums[i]`ʱ`j++`Ϳظʱ`i++``nums[i] = nums[j]`ֵƹִеĩβɣʱ临ӶΪ`O(n)`
+
+- ִнͨ
+- ִʱ300 ms, C# ύл 64.43% û
+- ڴģ33.5 MB, C# ύл 5.48% û
+
+```c
+public class Solution
+{
+ public int RemoveDuplicates(int[] nums)
+ {
+ if (nums.Length < 2)
+ return nums.Length;
+
+ int i = 0;
+ for (int j = 1; j < nums.Length; j++)
+ {
+ if (nums[j] != nums[i])
+ {
+ i++;
+ nums[i] = nums[j];
+ }
+ }
+ return i + 1;
+ }
+}
+```
+
+---
+## Ŀ03ƳԪ
+
+> - ţ27
+> - Ѷȣ
+> - https://leetcode-cn.com/problems/remove-element/
+
+
+һ`nums`һֵ`val`Ҫ**ԭ**Ƴֵ`val`ԪأƳ³ȡ
+
+Ҫʹöռ䣬**ԭ**ʹ O(1) ռɡ
+
+Ԫص˳Ըı䡣㲻Ҫг³ȺԪء
+
+**ʾ 1:**
+
+```c
+ nums = [3,2,2,3], val = 3,
+
+Ӧ÷µij 2, nums еǰԪؾΪ 2
+
+㲻Ҫг³ȺԪء
+```
+
+**ʾ 2:**
+
+```c
+ nums = [0,1,2,2,3,0,4,2], val = 2,
+
+Ӧ÷µij 5, nums еǰԪΪ 0, 1, 3, 0, 4
+
+עԪؿΪ˳
+
+㲻Ҫг³ȺԪء
+```
+
+**ʾ 3:**
+```c
+룺[] value = 0
+
+0
+```
+
+**ʾ 4:**
+```c
+룺[1] value = 1
+
+0
+```
+
+**ʾ 5:**
+
+```c
+룺[4,5] value = 5
+
+1
+```
+
+
+
+**˵:**
+
+ΪʲôֵĴ?
+
+ע⣬ԡ****ʽݵģζںڵǿɼġ
+
+ڲ:
+
+```c
+// nums ԡáʽݵġҲ˵ʵκο
+int len = removeElement(nums, val);
+
+// ںڵǿɼġ
+// ĺصij, ӡиóȷΧڵԪء
+for (int i = 0; i < len; i++) {
+ print(nums[i]);
+}
+```
+
+**ο룺**
+
+˼·˫˫`i``j``i`ΪϺ`j`Ϊǰ塣`nums[j]!=val``num[j]`ֵ`num[i]`ѭ`i`ָǰԪأΪҪԪأӶﵽƳԪصĿģʱ临ӶΪ `O(n)`
+
+- ִнͨ
+- ִʱ272 ms, C# ύл 94.41% û
+- ڴģ29.9 MB, C# ύл 5.21% û
+
+```c
+public class Solution
+{
+ public int RemoveElement(int[] nums, int val)
+ {
+ int i = 0;
+ for (int j = 0; j < nums.Length; j++)
+ {
+ if (nums[j] != val)
+ {
+ nums[i] = nums[j];
+ i++;
+ }
+ }
+ return i;
+ }
+}
+```
+
+
+---
+## Ŀ04
+
+> - ţ53
+> - Ѷȣ
+> - https://leetcode-cn.com/problems/maximum-subarray/
+
+һ`nums`ҵһ͵飨ٰһԪأ͡
+
+ʾ 1:
+```c
+: [-2,1,-3,4,-1,2,1,-5,4],
+: 6
+: [4,-1,2,1] ĺΪ 6
+```
+
+ʾ 2:
+```c
+: [-2,1],
+: 1
+```
+
+:
+
+ѾʵָӶΪ`O(n)`ĽⷨʹøΪķη⡣
+
+**ο룺**
+
+˼·ñ㷨
+
+- ״̬ͨ
+- ִʱ: 596 ms, C# ύл 14.18% û
+- ڴ: 24.5 MB, C# ύл 5.88% û
+
+```c
+public class Solution {
+ public int MaxSubArray(int[] nums) {
+ int len = nums.Length;
+ if (len == 0)
+ return 0;
+ if (len == 1)
+ return nums[0];
+ int max = int.MinValue;
+
+ for (int i = 0; i < len; i++)
+ {
+ int sum = nums[i];
+ if (sum > max)
+ {
+ max = sum;
+ }
+ for (int j = i + 1; j < len; j++)
+ {
+ sum += nums[j];
+ if (sum > max)
+ {
+ max = sum;
+ }
+ }
+ }
+ return max;
+ }
+}
+```
+
+---
+## Ŀ05ʢˮ
+
+
+> - ţ11
+> - Ѷȣе
+> - https://leetcode-cn.com/problems/container-with-most-water/
+
+`n`Ǹ`a1a2...an`ÿеһ`(i, ai)`ڻ`n`ֱߣֱ`i` ˵ֱΪ`(i, ai)``(i, 0)`ҳеߣʹ`x`Ṳͬɵˮ
+
+˵㲻б`n`ֵΪ 2
+
+
+
+ͼдֱߴ [1,8,6,2,5,4,8,3,7]ڴ£ܹˮʾΪɫֵ֣Ϊ 49
+
+ʾ:
+```c
+: [1,8,6,2,5,4,8,3,7]
+: 49
+```
+
+
+**ο룺**
+
+˼·˫ķ
+
+
+
+0-7ߵ1-7һΪΪʲô0-6һ֧
+
+```c
+h(i)ʾi߶εĸ߶ȣS(ij)ʾi߶κ͵j߶Ȧ
+
+֪ h(0) < h(7)ӶS(07) = h(0) * 7
+
+S(06) = min(h(0), h(6)) * 6
+
+h(0) <= h(6)S(06) = h(0) * 6
+h(0) > h(6)S(06) = h(6) * 6S(06) < h(0) * 6
+
+ɴ˿֪S(06)ȻСS(07)
+```
+ÿһͬķ֪˫ߵ·
+
+- ״̬ͨ
+- 50 / 50 ͨ
+- ִʱ: 144 ms, C# ύл 99.64% û
+- ڴ: 26.6 MB, C# ύл 5.45% û
+
+```c
+public class Solution
+{
+ public int MaxArea(int[] height)
+ {
+ int i = 0, j = height.Length - 1;
+ int max = int.MinValue;
+ while (i < j)
+ {
+ int temp = (j - i) * Math.Min(height[i], height[j]);
+ if (temp > max)
+ {
+ max = temp;
+ }
+ if (height[i] < height[j])
+ {
+ i++;
+ }
+ else
+ {
+ j--;
+ }
+ }
+ return max;
+ }
+}
+```
+
+---
+## Ŀ06ת
+
+> - ţ33
+> - Ѷȣе
+> - https://leetcode-cn.com/problems/search-in-rotated-sorted-array/
+
+谴Ԥδ֪ijϽת
+
+( 磬 [0,1,2,4,5,6,7] ܱΪ [4,5,6,7,0,1,2] )
+
+һĿֵдĿֵ -1
+
+ԼвظԪء
+
+㷨ʱ临Ӷȱ`O(log n)`
+
+ʾ 1:
+```c
+: nums = [4,5,6,7,0,1,2], target = 0
+: 4
+```
+
+ʾ 2:
+```c
+: nums = [4,5,6,7,0,1,2], target = 3
+: -1
+```
+
+ʾ 3:
+```c
+: nums = [5,1,3], target = 5
+: 0
+```
+
+ʾ 4:
+```c
+: nums = [4,5,6,7,8,1,2,3], target = 8
+: 4
+```
+
+ʾ 5:
+```c
+: nums = [3,1], target = 1
+: 1
+```
+
+**ο룺**
+
+˼·öַ
+
+- ״̬ͨ
+- ִʱ: 128 ms, C# ύл 97.17% û
+- ڴ: 23.8 MB, C# ύл 12.00% û
+
+```c
+public class Solution
+{
+ public int Search(int[] nums, int target)
+ {
+ int i = 0, j = nums.Length - 1;
+ while (i <= j)
+ {
+ int mid = (i + j) / 2;
+ if (nums[mid] == target)
+ return mid;
+
+ if (nums[mid] >= nums[i])
+ {
+ //벿
+ if (target > nums[mid])
+ {
+ i = mid + 1;
+ }
+ else
+ {
+ if (target == nums[i])
+ return i;
+
+ if (target > nums[i])
+ j = mid - 1;
+ else
+ i = mid + 1;
+ }
+ }
+ else
+ {
+ if (target < nums[mid])
+ {
+ j = mid - 1;
+ }
+ else
+ {
+ if (target == nums[j])
+ return j;
+ if (target < nums[j])
+ i = mid + 1;
+ else
+ j = mid - 1;
+ }
+ }
+ }
+ return -1;
+ }
+}
+```
+
+
+
+
+
+---
+## Ŀ07еĵKԪ
+
+> - ţ215
+> - Ѷȣе
+> - https://leetcode-cn.com/problems/kth-largest-element-in-an-array/
+
+δҵ `k` Ԫءע⣬Ҫҵĵ `k` Ԫأǵ `k` ͬԪء
+
+ʾ 1:
+```c
+: [3,2,1,5,6,4] k = 2
+: 5
+```
+
+ʾ 2:
+```c
+: [3,2,3,1,2,4,5,5,6] k = 4
+: 4
+```
+
+˵:
+
+Լ `k` Чģ `1 k ij`
+
+
+
+
+
+**ο룺**
+
+˼·ķ
+
+- ״̬ͨ
+- ִʱ: 152 ms, C# ύл 76.47% û
+- ڴ: 24.6 MB, C# ύл 5.55% û
+
+```c
+public class Solution
+{
+ public int FindKthLargest(int[] nums, int k)
+ {
+ nums = nums.OrderBy(a => a).ToArray();
+ return nums[nums.Length - k];
+ }
+}
+```
+
+
+
+
+---
+## Ŀ08ij˻
+
+
+> - ţ238
+> - Ѷȣе
+> - https://leetcode-cn.com/problems/product-of-array-except-self/
+
+Ϊ`n``nums``n > 1``output``output[i]` `nums`г`nums[i]`֮Ԫصij˻
+
+ʾ:
+```c
+: [1,2,3,4]
+: [24,12,8,6]
+```
+
+˵: 벻Ҫʹó`O(n)` ʱ临Ӷɴ⡣
+
+
+
+ڳռ临ӶĿ𣿣 ڶԿռ临ӶȷĿģ鲻Ϊռ䡣
+
+
+
+
+
+
+**ο룺**
+
+˼·˻ = ǰߵij˻ * ǰұߵij˻
+
+```c
+ [1, 2, 3, 4]
+ ߵij˻ [1, 1, 2, 6]
+ ұߵij˻ [24,12,4, 1]
+ = * [24,12,8, 6]
+```
+
+- ״̬ͨ
+- ִʱ: 304 ms, C# ύл 100.00% û
+- ڴ: 34.6 MB, C# ύл 100.00% û
+
+```c
+public class Solution
+{
+ public int[] ProductExceptSelf(int[] nums)
+ {
+ int len = nums.Length;
+ int[] output1 = new int[len];//˻
+ int[] output2 = new int[len];//˻
+ output1[0] = 1;
+ output2[len - 1] = 1;
+ for (int i = 1; i < len; i++)
+ {
+ output1[i] = output1[i - 1]*nums[i - 1];
+ output2[len - i - 1] = output2[len - i]*nums[len - i];
+ }
+ for (int i = 0; i < len; i++)
+ {
+ output1[i] *= output2[i];
+ }
+ return output1;
+ }
+}
+```
+
+
+---
+## Ŀ09Ѱλ
+
+
+> - ţ4
+> - Ѷȣ
+> - https://leetcode-cn.com/problems/median-of-two-sorted-arrays/
+
+СΪ`m``n``nums1``nums2`
+
+ҳλҪ㷨ʱ临ӶΪ`O(log(m + n))`
+
+Լ`nums1``nums2`ͬʱΪա
+
+ʾ 1:
+```c
+nums1 = [1, 3]
+nums2 = [2]
+
+λ 2.0
+```
+
+ʾ 2:
+
+```c
+nums1 = [1, 2]
+nums2 = [3, 4]
+
+λ (2 + 3)/2 = 2.5
+```
+
+**ο룺**
+
+˼·öֲԡ
+
+λһϻΪȵӼһӼеԪǴһӼеԪء
+
+ĿҪʱ临ӶΪ`O(log(m + n))`ԲܴβҵλӶ `O(m + n)`ҪֲͨԣͨÿαȽϣֱܹӰˢһ֣ҵλӶ`O(log(m + n))`
+
+```c
+nums1: [a1,a2,a3,...am]
+nums2: [b1,b2,b3,...bn]
+
+[nums1[:i],nums2[:j] | nums1[i:], nums2[j:]]
+
+nums1 ȡ i
+nums2 ȡ j = (m+n+1)/2 - i
+```
+ֻҪ֤ ͬλ `|` ߽Ա߲Ӷöַҵʵ`i`
+
+- ״̬ͨ
+- ִʱ: 160 ms, C# ύл 99.18% û
+- ڴ: 26.8 MB, C# ύл 5.05% û
+
+```c
+public class Solution {
+ public double FindMedianSortedArrays(int[] nums1, int[] nums2) {
+ int m = nums1.Length;
+ int n = nums2.Length;
+ if (m > n)
+ return FindMedianSortedArrays(nums2, nums1);
+
+ int k = (m + n + 1)/2;
+ int left = 0;
+ int right = m;
+ while (left < right)
+ {
+ int i = (left + right)/2;
+ int j = k - i;
+ if (nums1[i] < nums2[j - 1])
+ left = i + 1;
+ else
+ right = i;
+ }
+ int m1 = left;
+ int m2 = k - left;
+ int c1 = Math.Max(m1 == 0 ? int.MinValue : nums1[m1 - 1],
+ m2 == 0 ? int.MinValue : nums2[m2 - 1]);
+
+ if ((m + n)%2 == 1)
+ return c1;
+
+ int c2 = Math.Min(m1 == m ? int.MaxValue : nums1[m1],
+ m2 == n ? int.MaxValue : nums2[m2]);
+ return (c1 + c2)*0.5;
+ }
+}
+```
+
+---
+## Ŀ10ȱʧĵһ
+
+
+> - ţ41
+> - Ѷȣ
+> - https://leetcode-cn.com/problems/first-missing-positive/
+
+һδ飬ҳûгֵС
+
+ʾ1:
+
+```c
+: [1,2,0]
+: 3
+```
+
+ʾ2:
+
+```c
+: [3,4,-1,1]
+: 2
+```
+
+ʾ3:
+```c
+: [7,8,9,11,12]
+: 1
+```
+
+ʾ4:
+```c
+: [1,1]
+: 2
+```
+
+ʵ5:
+
+```c
+: []
+: 1
+```
+
+˵:
+
+㷨ʱ临ӶӦΪO(n)ֻʹóĿռ䡣
+
+**ο룺**
+
+˼·һΡĹǣ`i`ڡ䷶Χ`i`Ӧ÷Ϊ`i - 1`λϡ
+
+- ִнͨ
+- ִʱ100 ms, C# ύл 93.75% û
+- ڴģ24.2 MB, C# ύл 97.44% û
+
+
+```c
+public class Solution {
+ public int FirstMissingPositive(int[] nums) {
+ int len = nums.Length;
+ for (int i = 0; i < len; i++)
+ {
+ while (nums[i] != i + 1 && nums[i] <= len && nums[i] > 0 && nums[i] != nums[nums[i] - 1])
+ {
+ int temp = nums[i];
+ nums[i] = nums[temp - 1];
+ nums[temp - 1] = temp;
+ }
+ }
+ for (int i = 0; i < len; i++)
+ {
+ if (nums[i] != i + 1)
+ {
+ return i + 1;
+ }
+ }
+ return len + 1; //nums.Length = 0
+ }
+}
+```
+
+
+
diff --git a/DataStructureAndAlgorithm/05 数组.md b/DataStructureAndAlgorithm/06 数组.md
similarity index 100%
rename from DataStructureAndAlgorithm/05 数组.md
rename to DataStructureAndAlgorithm/06 数组.md
diff --git a/DataStructureAndAlgorithm/06 顺序表和链表.md b/DataStructureAndAlgorithm/07 顺序表和链表.md
similarity index 100%
rename from DataStructureAndAlgorithm/06 顺序表和链表.md
rename to DataStructureAndAlgorithm/07 顺序表和链表.md
diff --git a/DataStructureAndAlgorithm/07 栈与递归.md b/DataStructureAndAlgorithm/09 栈与递归.md
similarity index 100%
rename from DataStructureAndAlgorithm/07 栈与递归.md
rename to DataStructureAndAlgorithm/09 栈与递归.md
diff --git a/DataStructureAndAlgorithm/09 字符串.md b/DataStructureAndAlgorithm/10 字符串.md
similarity index 100%
rename from DataStructureAndAlgorithm/09 字符串.md
rename to DataStructureAndAlgorithm/10 字符串.md