提交 742cebd9 编写于 作者: L labuladong

update Summary.md and fix errors

上级 423fbdf7
......@@ -4,7 +4,7 @@ These articles are somehow kinds of **Algorithmic Thinking**. All based on LeetC
I don't like one liner and confusing, I like clear and easy-understanding.
Gitbook has deployed, will sync with this branch of the repo: https://labuladong.gitbook.io/algo-en/
**Gitbook** has deployed, will sync with this branch of the repo: https://labuladong.gitbook.io/algo-en/
If you want to clone this repo, please use following command:
......@@ -26,14 +26,14 @@ This command specifies the `english` branch and limit the depth of clone, get ri
* [How to Check the Validation of Parenthesis](interview/valid-parentheses.md)
* [How to Find Missing Element](interview/missing_elements.md)
* [How to Pick Elements From a Arbitrary Sequence](interview/ReservoirSampling.md)
* [How to use Binary Search](interview/UsingBinarySearchAlgorithm.md)
* [How to Scheduling Seats](interview/Seatscheduling.md)
* [Union-Find Algorithm in Detail](think_like_computer/Union-find-Explanation.md)
* [Union-Find Application](think_like_computer/Union-Find-Application.md)
* [Find Sebesquence With Binary Search](interview/findSebesquenceWithBinarySearch.md)
* [如何运用二分查找算法](interview/koko偷香蕉.md)
* [Problems can be sloved by one line](interview/one-line-code-puzzles.md)
* [如何寻找缺失和重复的元素](interview/缺失和重复的元素.md)
* [如何判断回文链表](interview/判断回文链表.md)
* [一行代码就能解决的算法题](interview/一行代码解决的智力题.md)
* II. Data Structure
* [Binary Head and Priority Queue](data_structure/binary_heap_implements_priority_queues.md)
......@@ -59,7 +59,7 @@ This command specifies the `english` branch and limit the depth of clone, get ri
* [Interval Scheduling: Interval Merging](think_like_computer/IntervalMerging.md)
* [Interval Scheduling: Intersections of Intervals](think_like_computer/IntervalIntersection.md)
* [String Multiplication](think_like_computer/string_multiplication.md)
* [烧饼排序](think_like_computer/烧饼排序.md)
* [Pancake Soring Algorithm](think_like_computer/PancakesSorting.md)
* [滑动窗口技巧](think_like_computer/滑动窗口技巧.md)
* [常用的位操作](think_like_computer/常用的位操作.md)
* [信封嵌套问题](think_like_computer/信封嵌套问题.md)
......
......@@ -13,14 +13,14 @@
* [How to Check the Validation of Parenthesis](interview/valid-parentheses.md)
* [How to Find Missing Element](interview/missing_elements.md)
* [How to Pick Elements From a Arbitrary Sequence](interview/ReservoirSampling.md)
* [How to use Binary Search](interview/UsingBinarySearchAlgorithm.md)
* [How to Scheduling Seats](interview/Seatscheduling.md)
* [Union-Find Algorithm in Detail](think_like_computer/Union-find-Explanation.md)
* [Union-Find Application](think_like_computer/Union-Find-Application.md)
* [Find Sebesquence With Binary Search](interview/findSebesquenceWithBinarySearch.md)
* [如何运用二分查找算法](interview/koko偷香蕉.md)
* [Problems can be sloved by one line](interview/one-line-code-puzzles.md)
* [如何寻找缺失和重复的元素](interview/缺失和重复的元素.md)
* [如何判断回文链表](interview/判断回文链表.md)
* [一行代码就能解决的算法题](interview/一行代码解决的智力题.md)
* II. Data Structure
* [Binary Head and Priority Queue](data_structure/binary_heap_implements_priority_queues.md)
......@@ -46,7 +46,7 @@
* [Interval Scheduling: Interval Merging](think_like_computer/IntervalMerging.md)
* [Interval Scheduling: Intersections of Intervals](think_like_computer/IntervalIntersection.md)
* [String Multiplication](think_like_computer/string_multiplication.md)
* [烧饼排序](think_like_computer/烧饼排序.md)
* [Pancake Soring Algorithm](think_like_computer/PancakesSorting.md)
* [滑动窗口技巧](think_like_computer/滑动窗口技巧.md)
* [常用的位操作](think_like_computer/常用的位操作.md)
* [信封嵌套问题](think_like_computer/信封嵌套问题.md)
......
......@@ -18,13 +18,13 @@ First of all, dynamic programming (DP) can be implemented into this problem, bec
**We usually use contrarian thinking to find a solution of this kind of problems**
If I win the game, I need to take the remaining stones (1~3 stones) at once.
If I win the game, I need to take the remaining stones (1\\~3 stones) at once.
How to make this situation come into being? If there are 4 stones remaining when your opponent takes the chance to pick the stones, no matter how he takes the stones, you can always win the game because there will always be 1~3 stones remaining.
How to make this situation come into being? If there are 4 stones remaining when your opponent takes the chance to pick the stones, no matter how he takes the stones, you can always win the game because there will always be 1\~3 stones remaining.
And how to force your opponent to face the situation when there are 4 stones left? If there are 5~7 stones remaining by the time you take your turn, you can let your opponent face 4-stone situation.
And how to force your opponent to face the situation when there are 4 stones left? If there are 5\~7 stones remaining by the time you take your turn, you can let your opponent face 4-stone situation.
Then how to get into a 5~7 stones situation when you are picking? Let your opponent face 8 stones. No matter how he plans to take the stones, we can win the game because of the remaining 5~7 stones.
Then how to get into a 5\~7 stones situation when you are picking? Let your opponent face 8 stones. No matter how he plans to take the stones, we can win the game because of the remaining 5\~7 stones.
And so on, we can find out that if n is a multiple of 4, you will fall into the trap and can never win the game. The solution to this problem is very simple:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册