摘要:
As the note in the problem statement, this problem has a straight-forward O(n)-space solution, which is to generate the inorder traversal results of t... 阅读全文
摘要:
This problem has a nice BFS structure. Let's illustrate it using the examplenums = [2, 3, 1, 1, 4]in the problem statement. We are initially at positi... 阅读全文
摘要:
This problem has a very concise solution in this link, just 4-lines. The code is rewritten below.1 class Solution {2 public:3 bool canJump(vector&... 阅读全文
摘要:
Well, this problem is just a trick. In fact, we cannot really delete the given node, but just delete its next node after copying the data of the next ... 阅读全文
摘要:
Note: If you feel unwilling to read the long codes, just take the idea with you. The codes are unnecessarily long due to the inconvenient handle of ma... 阅读全文