From 917375cf32cf57fc0756e5c32ed48843f2a7eef9 Mon Sep 17 00:00:00 2001 From: Jack Cui Date: Sun, 29 Mar 2020 21:14:22 +0800 Subject: [PATCH 01/11] Update README.md Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 79c670f..1f18d8f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # LeetCode -* 贵有恒,何必三更起五更睡;最无益,只怕一日暴十寒。
+* 贵有恒,何必三更起五更睡;最无益,只怕一日曝十日寒。
* [我的博客](http://blog.csdn.net/c406495762 "悬停显示")
* 我的个人网站:[http://cuijiahua.com/](http://cuijiahua.com/ "悬停显示")
* 分享技术,乐享生活:Jack Cui公众号每周五推送“程序员欢乐送”系列资讯类文章,欢迎您的关注! From 3423f8766b65e02c0a6237e9ab2dc5f787d5b0ac Mon Sep 17 00:00:00 2001 From: Jack Cui Date: Sun, 29 Mar 2020 21:21:19 +0800 Subject: [PATCH 02/11] Update README.md Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1f18d8f..09c8dac 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ * 贵有恒,何必三更起五更睡;最无益,只怕一日曝十日寒。
* [我的博客](http://blog.csdn.net/c406495762 "悬停显示")
* 我的个人网站:[http://cuijiahua.com/](http://cuijiahua.com/ "悬停显示")
-* 分享技术,乐享生活:Jack Cui公众号每周五推送“程序员欢乐送”系列资讯类文章,欢迎您的关注! +* 分享技术,乐享生活:Jack Cui公众号推送“程序员欢乐送”系列资讯类文章,以及技术类文章,欢迎您的关注!
Coder
## 帮助文档 From a3e00756ce6b8c5fee5ed891f70e24193150a444 Mon Sep 17 00:00:00 2001 From: Jack Cui Date: Wed, 8 Apr 2020 16:17:43 +0800 Subject: [PATCH 03/11] Update README.md Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 09c8dac..397561c 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ * 贵有恒,何必三更起五更睡;最无益,只怕一日曝十日寒。
* [我的博客](http://blog.csdn.net/c406495762 "悬停显示")
* 我的个人网站:[http://cuijiahua.com/](http://cuijiahua.com/ "悬停显示")
+* 公众号:[JackCui-AI](https://mp.weixin.qq.com/s/OCWwRVDFNslIuKyiCVUoTA "JackCui-AI")
* 分享技术,乐享生活:Jack Cui公众号推送“程序员欢乐送”系列资讯类文章,以及技术类文章,欢迎您的关注!
Coder
From 7f03f9e2ec7c1d65e765bcc4ef10267bb861a556 Mon Sep 17 00:00:00 2001 From: Jack Cui Date: Mon, 11 May 2020 11:03:22 +0800 Subject: [PATCH 04/11] Update REAME Update REAME --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 397561c..49bbb50 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # LeetCode * 贵有恒,何必三更起五更睡;最无益,只怕一日曝十日寒。
-* [我的博客](http://blog.csdn.net/c406495762 "悬停显示")
-* 我的个人网站:[http://cuijiahua.com/](http://cuijiahua.com/ "悬停显示")
+* [个人网站](https://cuijiahua.com/ "个人网站")
+* 学习交流群:关注公众号,回复交流群,拉你进群!
* 公众号:[JackCui-AI](https://mp.weixin.qq.com/s/OCWwRVDFNslIuKyiCVUoTA "JackCui-AI")
-* 分享技术,乐享生活:Jack Cui公众号推送“程序员欢乐送”系列资讯类文章,以及技术类文章,欢迎您的关注! -
Coder
+* 分享技术,乐享生活:Jack Cui公众号推送技术类文章,涉及深度学习、网络爬虫、Python基础等,欢迎您的关注! +
Coder
## 帮助文档 From 5a984042e03265dc418487e00493abd309668027 Mon Sep 17 00:00:00 2001 From: Jack Cui Date: Wed, 13 May 2020 10:43:05 +0800 Subject: [PATCH 05/11] Update README Update README --- README.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 49bbb50..cbe3442 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,14 @@ # LeetCode -* 贵有恒,何必三更起五更睡;最无益,只怕一日曝十日寒。
-* [个人网站](https://cuijiahua.com/ "个人网站")
-* 学习交流群:关注公众号,回复交流群,拉你进群!
-* 公众号:[JackCui-AI](https://mp.weixin.qq.com/s/OCWwRVDFNslIuKyiCVUoTA "JackCui-AI")
-* 分享技术,乐享生活:Jack Cui公众号推送技术类文章,涉及深度学习、网络爬虫、Python基础等,欢迎您的关注! -
Coder
+ +原创文章每周最少两篇,**后续最新文章**会在[【公众号】](#公众号)首发,大家可以加我[【微信】](#微信)进**交流群**,技术交流或提意见都可以,欢迎**Star**! + +

+ 微信群 + 公众号 + 投稿 + 投稿 + 投稿 +

## 帮助文档 @@ -193,3 +197,9 @@ * [剑指Offer(五十四):字符流中第一个不重复的字符](http://cuijiahua.com/blog/2018/01/basis_54.html "悬停显示") * [剑指Offer(六十三):数据流中的中位数](http://cuijiahua.com/blog/2018/02/basis_63.html "悬停显示") * [剑指Offer(六十四):滑动窗口的最大值](http://cuijiahua.com/blog/2018/02/basis_64.html "悬停显示") + +更多精彩,敬请期待! + + + +![公众号](https://cuijiahua.com/wp-content/uploads/2020/05/gzh-w.jpg) From 51e7c78c400e54547de3438f2a88d6308148386a Mon Sep 17 00:00:00 2001 From: Jack Cui Date: Thu, 18 Jun 2020 22:37:31 +0800 Subject: [PATCH 06/11] Update README.md update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cbe3442..ec41c91 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ | 290 | Easy | Word Pattern.mde | [Python](https://github.com/Jack-Cherish/LeetCode/blob/master/Hash%20Table/Easy/290.Word%20Pattern.md "悬停显示") | no | [思路讲解](https://github.com/Jack-Cherish/LeetCode/blob/master/Hash%20Table/Easy/290.Word%20Pattern.md "悬停显示") | # 剑指Offer(已完成) -* 贵有恒,何必三更起五更睡;最无益,只怕一日暴十寒。
+ * [个人网站](http://cuijiahua.com/ "悬停显示")
### 链表(8道): From cf884af670d1267761ea125adf15db82335e6308 Mon Sep 17 00:00:00 2001 From: Jack Cui Date: Sat, 18 Jul 2020 11:15:13 +0800 Subject: [PATCH 07/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ec41c91..ccb2921 100644 --- a/README.md +++ b/README.md @@ -202,4 +202,4 @@ -![公众号](https://cuijiahua.com/wp-content/uploads/2020/05/gzh-w.jpg) +wechat From bcbdf46d1322b68edce2f9cf5e1d610c462b2e19 Mon Sep 17 00:00:00 2001 From: Jack Cui Date: Fri, 31 Jul 2020 22:14:23 +0800 Subject: [PATCH 08/11] Update README.md --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ccb2921..0e8998e 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,14 @@ # LeetCode -原创文章每周最少两篇,**后续最新文章**会在[【公众号】](#公众号)首发,大家可以加我[【微信】](#微信)进**交流群**,技术交流或提意见都可以,欢迎**Star**! +原创文章每周最少两篇,**后续最新文章**会在[【公众号】](#公众号)首发,视频[【B站】](https://space.bilibili.com/331507846)首发,大家可以加我[【微信】](#微信)进**交流群**,技术交流或提意见都可以,欢迎**Star**!

微信群 公众号 - 投稿 - 投稿 - 投稿 + B站 + 知乎 + CSDN + 掘金

## 帮助文档 From 5ca87fd50421a914478ad71c35a069bee16b48b1 Mon Sep 17 00:00:00 2001 From: Jack Cui Date: Fri, 25 Sep 2020 20:47:04 +0800 Subject: [PATCH 09/11] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0e8998e..4de4dfa 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # LeetCode -原创文章每周最少两篇,**后续最新文章**会在[【公众号】](#公众号)首发,视频[【B站】](https://space.bilibili.com/331507846)首发,大家可以加我[【微信】](#微信)进**交流群**,技术交流或提意见都可以,欢迎**Star**! +原创文章每周最少两篇,**后续最新文章**会在[【公众号】](https://cuijiahua.com/wp-content/uploads/2020/05/gzh-w.jpg)首发,视频[【B站】](https://space.bilibili.com/331507846)首发,大家可以加我[【微信】](https://cuijiahua.com/wp-content/uploads/2020/05/gzh-w.jpg)进**交流群**,技术交流或提意见都可以,欢迎**Star**!

- 微信群 - 公众号 + 微信群 + 公众号 B站 知乎 CSDN From 13e5acee4070b051587ac90d221544bd9e80006c Mon Sep 17 00:00:00 2001 From: Aman Dwivedi <57112545+born69confused@users.noreply.github.com> Date: Sun, 4 Oct 2020 15:58:21 +0530 Subject: [PATCH 10/11] 1367.Linked List in Binary Tree C++ and Python Solution of the leetcode question 1367 with neat and clear Depth First Search Technique. c++ : Runtime: 40 ms, faster than 98.95%. Memory Usage: 32.4 MB. Python: Runtime: 76 ms, faster than 100.00%. Memory Usage: 18.7 MB. --- .../Medium/1367.Linked List in Binary Tree | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 Linked List/Medium/1367.Linked List in Binary Tree diff --git a/Linked List/Medium/1367.Linked List in Binary Tree b/Linked List/Medium/1367.Linked List in Binary Tree new file mode 100644 index 0000000..9d54652 --- /dev/null +++ b/Linked List/Medium/1367.Linked List in Binary Tree @@ -0,0 +1,73 @@ +QUESTION : +Given a binary tree root and a linked list with head as the first node. +Return True if all the elements in the linked list starting from the head correspond to some downward path connected in the binary tree otherwise return False. +In this context downward path means a path that starts at some node and goes downwards. + +Example 1: +Input: head = [4,2,8], root = [1,4,4,null,2,2,null,1,null,6,8,null,null,null,null,1,3] +Output: true +Explanation: Nodes in blue form a subpath in the binary Tree. + +Example 2: +Input: head = [1,4,2,6], root = [1,4,4,null,2,2,null,1,null,6,8,null,null,null,null,1,3] +Output: true + +Example 3: +Input: head = [1,4,2,6,8], root = [1,4,4,null,2,2,null,1,null,6,8,null,null,null,null,1,3] +Output: false +Explanation: There is no path in the binary tree that contains all the elements of the linked list from head. + +Constraints: +1 <= node.val <= 100 for each node in the linked list and binary tree. +The given linked list will contain between 1 and 100 nodes. +The given binary tree will contain between 1 and 2500 nodes. + +C++ SOLUTION : + +class Solution { +public: + bool isSubPath(ListNode* head, TreeNode* root) { + if(root){ + if(isEqual(head, root)){ + return true; + } + return isSubPath(head, root->left) || isSubPath(head, root->right); + } + return false; + } + bool isEqual(ListNode* head, TreeNode* root){ + if(!head){ + return true; + } + if(!root){ + return false; + } + return head->val == root->val && (isEqual(head->next, root->left) || isEqual(head->next, root->right)); + } +}; + +PYTHON SOLUTION : + +def isSubPath(self, head: ListNode, root: TreeNode) -> bool: + target = "" + while head: + target = target + str(head.val) + head = head.next + + def dfs(root, path): + if target in path: + return True + + if root.left: + ans = dfs(root.left, path + str(root.left.val)) + if ans == True: + return True + + if root.right: + ans = dfs(root.right, path + str(root.right.val)) + if ans == True: + return True + + return False + + return dfs(root, str(root.val)) From de27c8eefd1f484ada0bc2fd506b09a9d17ff8a7 Mon Sep 17 00:00:00 2001 From: Jack Cui Date: Sun, 22 Nov 2020 12:52:43 +0800 Subject: [PATCH 11/11] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4de4dfa..3132639 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ B站 知乎 CSDN + 头条 掘金