摘要:
```C++ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: int ... 阅读全文
摘要:
两种思路,第一种就是在数组两边放置两个指针,第二种是在数组左边放置两个快慢指针。第二种方法更简洁,并且可以扩展至单链表的情形。推荐使用 C++ include include include include include include include include include using 阅读全文
摘要:
```C++ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: int ... 阅读全文
摘要:
```python3
"""
# Definition for a Node.
class Node(object): def __init__(self, val, children): self.val = val self.children = children
"""
class Solution(object): def maxDepth(... 阅读全文